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
13 changes: 9 additions & 4 deletions .github/workflows/auto-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
echo "base=$base_branch" >> $GITHUB_OUTPUT
exit 0
fi
git checkout "$base_branch"
if grep -q "^$version$" docs/change_log.md; then
# Check remote file content without checkout to avoid ambiguity/detached HEAD issues
if git show "origin/$base_branch:docs/change_log.md" | grep -q "^$version$"; then
echo "Already present in changelog."; upd=false
else
upd=true
Expand All @@ -64,10 +64,15 @@ jobs:
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 }}
git checkout -b "$branch"
branch="chore/changelog-${{ steps.detect.outputs.version }}"
base="${{ steps.detect.outputs.base }}"

# Create new branch from remote base
git checkout -b "$branch" "origin/$base"

git add docs/change_log.md
git commit -m "chore: add changelog for ${{ steps.detect.outputs.version }}"
git push origin "$branch" --force

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