Skip to content

Commit 1c56667

Browse files
committed
ci: implement automated release workflow with version bumping and changelog generation
1 parent 1bc7b9e commit 1c56667

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ jobs:
5656
with:
5757
# Fetch all history for changelog generation
5858
fetch-depth: 0
59-
# Checkout the specific commit created by the version bump job
60-
ref: ${{ needs.calculate-version.outputs.version_commit_sha }}
59+
# Checkout the branch, not the specific commit, to avoid detached HEAD
60+
ref: ${{ github.ref_name }}
6161

6262
- name: Set up Node.js
6363
uses: actions/setup-node@v4
@@ -80,7 +80,7 @@ jobs:
8080
# Check if there are changes to commit to avoid error if changelog is empty or unchanged
8181
if ! git diff --staged --quiet; then
8282
git commit -m "docs(changelog): update CHANGELOG.md for v${{ needs.calculate-version.outputs.new_version }}"
83-
git push
83+
git push origin HEAD:${{ github.ref_name }} # Push to the correct branch
8484
else
8585
echo "No changes to CHANGELOG.md to commit."
8686
fi

0 commit comments

Comments
 (0)