Skip to content

Commit

Permalink
Update the changelog automatically when releasing (spotbugs#2777)
Browse files Browse the repository at this point in the history
* ci: Update the changelog automatically when releasing

* docs: It shouldn't be required to update the changelog manually for a PR
  • Loading branch information
gtoison authored Dec 19, 2023
1 parent bcbace9 commit 8d7d9c1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
6 changes: 0 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@ Before opening a 'pull request'
* Check our discussions to see if the issue was already discussed.
* Check for specific project we support to raise the issue on, under [spotbugs](https://github.com/spotbugs)
* Do not open intellij plugin issues here, open them at [intellij-plugin](https://github.com/JetBrains/spotbugs-intellij-plugin) *

----

Make sure these boxes are checked before submitting your PR -- thank you!

- [ ] Added an entry into `CHANGELOG.md` if you have changed SpotBugs code
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Get previous tag for the change log
id: previousTag
run: |
name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | tail -2 | head -1)
echo "previousTag: $name"
echo "previousTag=$name" >> $GITHUB_ENV
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
toTag: ${{ github.ref }}
fromTag: ${{ env.previousTag }}
writeToFile: true
continue-on-error: true

- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: ${{ github.base_ref}}
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }}'
file_pattern: CHANGELOG.md

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand Down

0 comments on commit 8d7d9c1

Please sign in to comment.