Skip to content

Commit

Permalink
updated the changelog-update
Browse files Browse the repository at this point in the history
  • Loading branch information
bhanuba committed Oct 23, 2023
1 parent 7135c13 commit a4f86a5
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/changelog-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Update changelog

on:
pull_request_review:
types: [ submitted ]
jobs:
update:
runs-on: ubuntu-latest

permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# updated CHANGELOG-AWS.md back to the repository.
# https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
contents: write
steps:
- name: Checkout action
uses: actions/checkout@v3
- name : checkout
run : |
git config --global user.name 'Github Action'
git config --global user.email '[email protected]'
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: ~1.21.1
cache: false
- name: make update changelog
run: make chlog-update-aws
- name: switching from HTTPS to SSH
run: git remote set-url origin https://github.com/amazon-contributing/opentelemetry-collector-contrib.git
- name: check for changes
run: |
git branch
git status
- name: stage changed files
run: git add ./CHANGELOG-AWS.md
- name: commit changed files
run: |
git config --global user.name 'Github Action'
git config --global user.email '[email protected]'
git commit -m "Auto updating changelog-aws.md"
- name: pull from master
run: |
git remote -v
git pull
- name: push code to aws-cwa-dev
run: git push origin aws-cwa-dev
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This action requires that any PR targeting the main branch should add a
# This action requires that any PR targeting the aws-cwa-dev branch should add a
# yaml file to the ./.chloggen/ directory. If a CHANGELOG entry is not required,
# or if performing maintance on the Changelog, add either \"[chore]\" to the title of
# the pull request or add the \"Skip Changelog\" label to disable this action.
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING-AWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ The [CHANGELOG-AWS.md](./CHANGELOG-AWS.md) files in this repo is autogenerated f

The name of your file must be unique since the last release.

During the collector release process, all `./chloggen-aws/*.yaml` files are transcribed into `CHANGELOG-aws.md` and then deleted.

Once the PR has been approved and submitted the changelog-update.yml gets auto trigger to update the changelog-aws.md file.
**Recommended Steps**
1. Create an entry file using `make chlog-new-aws`. This generates a file based on your current branch (e.g. `./.chloggen-aws/my-branch.yaml`)
2. Fill in all fields in the new file
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ chlog-preview-aws: $(CHLOGGEN)

.PHONY: chlog-update-aws
chlog-update-aws: $(CHLOGGEN)
$(CHLOGGEN) update --config $(CHLOGGEN_CONFIG_AWS) --version $(VERSION)
$(CHLOGGEN) update --config $(CHLOGGEN_CONFIG_AWS) --version `date +'%y.%m.%d %H:%M:%S'`

.PHONY: genotelcontribcol
genotelcontribcol: $(BUILDER)
Expand Down

0 comments on commit a4f86a5

Please sign in to comment.