File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -58,20 +58,21 @@ jobs:
5858 echo 'Preview:'
5959 grep -n "^${{ steps.detect.outputs.version }}$" -A12 docs/change_log.md || true
6060
61- - name : Commit changes
61+ - name : Stage changes
6262 if : ${{ steps.detect.outputs.update == 'true' }}
6363 run : |
6464 set -e
65- git config user.name 'github-actions[bot]'
66- git config user.email 'github-actions[bot]@users.noreply.github.com'
67- branch="chore/changelog-${{ steps.detect.outputs.version }}"
65+ # Ensure we are on the correct base branch before staging
6866 base="${{ steps.detect.outputs.base }}"
67+ git checkout -B "$base" "origin/$base"
6968
70- # Create new branch from remote base
71- git checkout -b "$branch" "origin/$base"
69+ # Run generation again to ensure file is updated in the correct branch context if needed
70+ # (Optional, but safe if the previous step modified a file in a detached head or different branch)
71+ python .github/scripts/gen_changelog.py "${{ steps.detect.outputs.version }}"
7272
73+ git config user.name 'github-actions[bot]'
74+ git config user.email 'github-actions[bot]@users.noreply.github.com'
7375 git add docs/change_log.md
74- git commit -m "chore: add changelog for ${{ steps.detect.outputs.version }}"
7576
7677 - name : Create Pull Request
7778 if : ${{ steps.detect.outputs.update == 'true' }}
You can’t perform that action at this time.
0 commit comments