File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,16 @@ jobs:
3636 git config user.name "github-actions[bot]"
3737 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
3838
39- # Fetch the main branch to ensure local ref is up-to-date
40- git fetch origin main
39+ # Fetch the latest main branch from origin
40+ # Use refs/heads/main to be explicit about fetching the branch, not a tag named main
41+ git fetch origin refs/heads/main
4142
42- # Checkout main branch
43- git checkout main
43+ # Create a new branch based on the fetched origin/main
44+ git checkout -b changelog-update origin/ main
4445
45- # Add, commit, and push the changelog to main
46+ # Add, commit the changelog to the new branch
4647 git add ./CHANGELOG.md
47- # Use --allow-empty in case the changelog hasn't changed (e.g., rerunning on same tag)
4848 git commit --allow-empty -m "chore(docs): update CHANGELOG for latest tag [skip ci]"
49- git push origin main
49+
50+ # Push the new local branch to the remote main branch
51+ git push origin changelog-update:main
You can’t perform that action at this time.
0 commit comments