diff --git a/.github/workflows/release-new.yml b/.github/workflows/release-new.yml index 7b84600..c3a6315 100644 --- a/.github/workflows/release-new.yml +++ b/.github/workflows/release-new.yml @@ -83,9 +83,14 @@ jobs: - name: Write changelog to file run: echo "${{ steps.changelog.outputs.changelog }}" > CHANGELOG.md + - name: Get the branch name + id: branch_name + run: echo "::set-output name=branch::$(if [ "${{ github.event_name }}" = "pull_request" ]; then echo ${{ github.head_ref }}; else echo ${GITHUB_REF#refs/heads/}; fi)" + - name: Commit CHANGELOG.md uses: stefanzweifel/git-auto-commit-action@v5 with: + branch: ${{ steps.branch_name.outputs.branch }} commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]' file_pattern: CHANGELOG.md