File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 4141 echo "base=$base_branch" >> $GITHUB_OUTPUT
4242 exit 0
4343 fi
44- git checkout "$base_branch"
45- if grep -q "^$version$" docs/change_log.md ; then
44+ # Check remote file content without checkout to avoid ambiguity/detached HEAD issues
45+ if git show "origin/$base_branch:docs/change_log.md" | grep -q "^$version$"; then
4646 echo "Already present in changelog."; upd=false
4747 else
4848 upd=true
@@ -64,10 +64,15 @@ jobs:
6464 set -e
6565 git config user.name 'github-actions[bot]'
6666 git config user.email 'github-actions[bot]@users.noreply.github.com'
67- branch=chore/changelog-${{ steps.detect.outputs.version }}
68- git checkout -b "$branch"
67+ branch="chore/changelog-${{ steps.detect.outputs.version }}"
68+ base="${{ steps.detect.outputs.base }}"
69+
70+ # Create new branch from remote base
71+ git checkout -b "$branch" "origin/$base"
72+
6973 git add docs/change_log.md
7074 git commit -m "chore: add changelog for ${{ steps.detect.outputs.version }}"
75+ git push origin "$branch" --force
7176
7277 - name : Create Pull Request
7378 if : ${{ steps.detect.outputs.update == 'true' }}
You can’t perform that action at this time.
0 commit comments