Skip GITHUB_TOKEN-incompatible push-perm probe in script/publish under Actions - #2701
Merged
Merged
Conversation
check_github_permissions runs: gh api repos/ViewComponent/view_component -q '.permissions.push // false' But GET /repos/:owner/:repo only returns the '.permissions' object for user/OAuth tokens. For the workflow's GITHUB_TOKEN the field is absent, so '.permissions.push // false' resolves to "false" and the script bails with 'insufficient permissions to create releases' even though the publish-release job declares 'contents: write'. Skip the probe when GITHUB_ACTIONS is set. In CI we already rely on the job's declared permissions; any real permission problem will surface with a clear message from the actual 'git push' or 'gh release create' calls that follow. Local runs still get the probe. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 217f0a0d-a9f2-4607-9643-5fcb3e34f20f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up. After #2700 landed and Publish Release was re-triggered manually,
script/publishstill aborted:Root cause
check_github_permissionsprobes push access with:gh api repos/ViewComponent/view_component -q '.permissions.push // false'But
GET /repos/:owner/:repoonly includes the.permissionsobject when queried by a user/OAuth token. For the workflow'sGITHUB_TOKEN, the field is absent, so.permissions.push // falseresolves to"false"and the script bails — even though thepublish-releasejob declarescontents: writeand can actually push and create releases.Fix
Skip the probe when running in GitHub Actions (
$GITHUB_ACTIONS). In CI we already rely on the job's declared permissions; any real permission problem will surface with a clear message from the subsequentgit push origin $tag,git push origin gh-pages --force, orgh release createcalls. Local runs still get the probe.Recovery
Once this merges, re-run Publish Release (workflow_dispatch on
main) to publish 4.14.0.script/publishis idempotent for the tag creation, so a partial prior run doesn't block a retry.