Skip to content

Commit de48b55

Browse files
committed
update generate-changelog to specify a branch to checkout to before committing
1 parent 2dd2a5b commit de48b55

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/generate-changelog.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ jobs:
1818
-u ${{ github.repository_owner }} \
1919
-p ${{ github.event.repository.name }} \
2020
--token ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
21-
- uses: stefanzweifel/git-auto-commit-action@v5
21+
- name: Checkout to branch
22+
run: |
23+
git checkout "${GITHUB_REF#refs/heads/}"
24+
- name: Commit Changelog
25+
uses: stefanzweifel/git-auto-commit-action@v5
2226
with:
2327
commit_message: "chore: update changelog"
24-
branch: ${{ github.head_ref }}
28+
branch: ${{ github.head_ref || github.ref_name }}
2529
file_pattern: "CHANGELOG.md"
2630
commit_author: "GitHub Action <actions@github.com>"

0 commit comments

Comments
 (0)