File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,16 @@ jobs:
36
36
git config user.name "github-actions[bot]"
37
37
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
38
38
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
41
42
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
44
45
45
- # Add, commit, and push the changelog to main
46
+ # Add, commit the changelog to the new branch
46
47
git add ./CHANGELOG.md
47
- # Use --allow-empty in case the changelog hasn't changed (e.g., rerunning on same tag)
48
48
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