Skip to content

Commit

Permalink
Fix "Bump changelog on release" GH Action (#1188)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
chrysle and pre-commit-ci[bot] authored Jan 8, 2024
1 parent 98c803f commit 0ea5ed6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,19 @@ jobs:
uses: actions/checkout@v4
- name: Extract release tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Create pull request branch
run: git switch -c "bump-changelog-for-${RELEASE_VERSION}"
- name: Update changelog
run: echo -e "## dev\n\n## $RELEASE_VERSION\n$(tail -n +2 CHANGELOG.md)" > CHANGELOG.md
- name: Commit and push change
run: |
git config --global user.name 'Github Actions'
git config --global user.email 'gh-action@users.noreply.github.com'
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git commit -am "Bump changelog for $RELEASE_VERSION"
git push origin HEAD:main
git push origin "bump-changelog-for-${RELEASE_VERSION}"
- name: Create pull request
run: |
git fetch origin
gh pr create --base main --fill
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 0ea5ed6

Please sign in to comment.