Fix Release Stage 2 failure: add workflows permission and concurrency controls #235
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Release Stage 2 workflow was failing when attempting to create GitHub releases with the following error:
Root Cause
The
mini-bomba/create-github-release:v1.2.0
Docker action was attempting to create Git tags, but the workflow's GitHub token lacked theworkflows
permission required to create tags that could potentially trigger other workflows. This is a security feature in GitHub that prevents unauthorized workflow triggers via tag creation.Solution
Added the
workflows: write
permission to the Release Stage 2 workflow and implemented concurrency controls to prevent race conditions:Changes Made
.github/workflows/release-stage-2_build_and_release.yml
: Addedworkflows: write
permission and concurrency controlstest/test-permissions-fix.sh
: Created comprehensive test to validate the permissions fixtest/test-concurrency-fix.sh
: Created test to validate the concurrency controlsPERMISSIONS_FIX.md
: Added documentation explaining the permissions issue and solutionCONCURRENCY_FIX.md
: Added documentation explaining the concurrency controlsValidation
The workflow now has proper concurrency controls to prevent multiple instances from running simultaneously (avoiding race conditions in package building, GitHub release creation, APT repository uploads, and NPM publishing) and sufficient permissions for tag creation, allowing stable, beta, and alpha releases to complete successfully.
Fixes #234.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.