Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/auto-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,21 @@ jobs:
echo 'Preview:'
grep -n "^${{ steps.detect.outputs.version }}$" -A12 docs/change_log.md || true

- name: Commit changes
- name: Stage changes
if: ${{ steps.detect.outputs.update == 'true' }}
run: |
set -e
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
branch="chore/changelog-${{ steps.detect.outputs.version }}"
# Ensure we are on the correct base branch before staging
base="${{ steps.detect.outputs.base }}"
git checkout -B "$base" "origin/$base"

# Create new branch from remote base
git checkout -b "$branch" "origin/$base"
# Run generation again to ensure file is updated in the correct branch context if needed
# (Optional, but safe if the previous step modified a file in a detached head or different branch)
python .github/scripts/gen_changelog.py "${{ steps.detect.outputs.version }}"

git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add docs/change_log.md
git commit -m "chore: add changelog for ${{ steps.detect.outputs.version }}"

- name: Create Pull Request
if: ${{ steps.detect.outputs.update == 'true' }}
Expand Down