From 2b875da1a20e0a1935923deaef72dfeae59b6973 Mon Sep 17 00:00:00 2001 From: lei Date: Thu, 9 Apr 2026 21:58:23 +0300 Subject: [PATCH] fix: commit changelog before tagging to fix goreleaser dirty-state error 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. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/release.yml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c0f9d1b..801bdb1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,14 +52,16 @@ jobs: # Release notes for this version only (passed to goreleaser) git-cliff --tag ${{ github.event.inputs.version }} --latest --strip header -o RELEASE_NOTES.md - - name: Tag and push release + - name: Commit changelog and tag release run: | VERSION="${{ github.event.inputs.version }}" git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git remote set-url origin https://x-access-token:${{ secrets.RELEASE_TOKEN }}@github.com/${{ github.repository }} + git add CHANGELOG.md RELEASE_NOTES.md + git commit -m "chore(release): update changelog for ${VERSION}" git tag "${VERSION}" - git push origin --tags + git push origin main --tags - name: Install cosign uses: sigstore/cosign-installer@v3 @@ -149,18 +151,5 @@ jobs: "dist/verda_${VER}_SHA256SUMS.sig" \ "dist/verda_${VER}_SHA256SUMS.pem" - - name: Commit changelog and create PR - env: - GH_TOKEN: ${{ secrets.RELEASE_TOKEN }} - run: | - VERSION="${{ github.event.inputs.version }}" - BRANCH="chore/changelog-${VERSION}" - git checkout -b "${BRANCH}" - git add CHANGELOG.md - git commit -m "chore(release): update changelog for ${VERSION}" - git push origin "${BRANCH}" - gh pr create \ - --base main \ - --head "${BRANCH}" \ - --title "chore(release): update changelog for ${VERSION}" \ - --body "Updates CHANGELOG.md with release notes for ${VERSION}." + - name: Clean up release notes + run: rm -f RELEASE_NOTES.md