Skip to content

Commit 897ef0e

Browse files
authored
fix: commit changelog before tagging to fix goreleaser dirty-state error (#36)
The release workflow generated CHANGELOG.md and RELEASE_NOTES.md but never committed them before creating the git tag. Goreleaser's dirty-state check caught the uncommitted files and aborted the release. Now commits both files before tagging, and removes the redundant changelog PR step since the changelog is committed directly to main.
1 parent 2b00794 commit 897ef0e

1 file changed

Lines changed: 6 additions & 17 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@ jobs:
5252
# Release notes for this version only (passed to goreleaser)
5353
git-cliff --tag ${{ github.event.inputs.version }} --latest --strip header -o RELEASE_NOTES.md
5454
55-
- name: Tag and push release
55+
- name: Commit changelog and tag release
5656
run: |
5757
VERSION="${{ github.event.inputs.version }}"
5858
git config user.name "github-actions[bot]"
5959
git config user.email "github-actions[bot]@users.noreply.github.com"
6060
git remote set-url origin https://x-access-token:${{ secrets.RELEASE_TOKEN }}@github.com/${{ github.repository }}
61+
git add CHANGELOG.md RELEASE_NOTES.md
62+
git commit -m "chore(release): update changelog for ${VERSION}"
6163
git tag "${VERSION}"
62-
git push origin --tags
64+
git push origin main --tags
6365
6466
- name: Install cosign
6567
uses: sigstore/cosign-installer@v3
@@ -149,18 +151,5 @@ jobs:
149151
"dist/verda_${VER}_SHA256SUMS.sig" \
150152
"dist/verda_${VER}_SHA256SUMS.pem"
151153
152-
- name: Commit changelog and create PR
153-
env:
154-
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
155-
run: |
156-
VERSION="${{ github.event.inputs.version }}"
157-
BRANCH="chore/changelog-${VERSION}"
158-
git checkout -b "${BRANCH}"
159-
git add CHANGELOG.md
160-
git commit -m "chore(release): update changelog for ${VERSION}"
161-
git push origin "${BRANCH}"
162-
gh pr create \
163-
--base main \
164-
--head "${BRANCH}" \
165-
--title "chore(release): update changelog for ${VERSION}" \
166-
--body "Updates CHANGELOG.md with release notes for ${VERSION}."
154+
- name: Clean up release notes
155+
run: rm -f RELEASE_NOTES.md

0 commit comments

Comments
 (0)