Skip to content

Harden release workflow against immutable existing tag releases#1

Merged
aacle merged 2 commits into
mainfrom
copilot/fix-create-release-job
Jun 23, 2026
Merged

Harden release workflow against immutable existing tag releases#1
aacle merged 2 commits into
mainfrom
copilot/fix-create-release-job

Conversation

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

The Create Release GitHub Actions job failed on reruns for an existing tag because asset upload was attempted against an already-created immutable release (422 Cannot upload assets to an immutable release). This change makes the release path safe for repeated executions on the same tag.

  • Root-cause alignment

    • softprops/action-gh-release was always invoked, even when a release for github.ref_name already existed.
  • Workflow change

    • Added a pre-check step in .github/workflows/build.yml to detect whether the tag release already exists.
    • Gated the release creation/upload step to run only when no existing release is found.
  • Behavioral impact

    • First run on a new tag still creates release + uploads assets.
    • Subsequent runs on the same tag skip upload instead of failing.
- name: Check if release already exists
  id: release_check
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  run: |
    if gh release view "${{ github.ref_name }}" > /dev/null 2>&1; then
      echo "exists=true" >> "$GITHUB_OUTPUT"
    else
      echo "exists=false" >> "$GITHUB_OUTPUT"
    fi

- name: Create GitHub Release
  if: steps.release_check.outputs.exists != 'true'
  uses: softprops/action-gh-release@v1

Copilot AI changed the title [WIP] Fix failing GitHub Actions job 'Create Release' Harden release workflow against immutable existing tag releases Jun 23, 2026
Copilot finished work on behalf of aacle June 23, 2026 08:10
Copilot AI requested a review from aacle June 23, 2026 08:10
@aacle aacle marked this pull request as ready for review June 23, 2026 08:21
@aacle aacle merged commit 99211c3 into main Jun 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants