Fix GitHub Actions workflow permission issue for triggering stage-2 builds #207
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 alpha release workflow was failing at the final step when trying to trigger the stage-2 build workflow with the error:
This occurred because the workflow was using the default
github.token
instead of the privilegedsecrets.GH_TOKEN
to trigger another workflow. GitHub requires elevated permissions to trigger workflows from other workflows for security reasons.Root Cause
In
.github/workflows/release-stage-1_update_dependencies.yml
, the "Trigger Build and Release" step was configured with:The default
github.token
lacks the necessary permissions to dispatch other workflows, resulting in HTTP 403 errors.Fix
Changed the token reference to use the privileged token that's already configured elsewhere in the same workflow:
This change makes the workflow dispatch step consistent with the homebridge-bot step on line 61, which already uses
secrets.GH_TOKEN
for PR operations that require elevated permissions.Impact
This minimal one-line change will allow the alpha, beta, and stable dependency update workflows to successfully trigger the stage-2 build workflows after completing dependency updates and PR merges. The multi-stage release process will now complete end-to-end without permission errors.
Fixes #206.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.