Skip to content

Skip GITHUB_TOKEN-incompatible push-perm probe in script/publish under Actions - #2701

Merged
joelhawksley merged 1 commit into
mainfrom
joelhawksley-redesigned-sniffle
Aug 24, 2026
Merged

Skip GITHUB_TOKEN-incompatible push-perm probe in script/publish under Actions#2701
joelhawksley merged 1 commit into
mainfrom
joelhawksley-redesigned-sniffle

Conversation

@joelhawksley

Copy link
Copy Markdown
Member

Follow-up. After #2700 landed and Publish Release was re-triggered manually, script/publish still aborted:

Error: insufficient permissions to create releases in ViewComponent/view_component
You need at least 'push' (write) access to the repository
Error: Process completed with exit code 1.

Root cause

check_github_permissions probes push access with:

gh api repos/ViewComponent/view_component -q '.permissions.push // false'

But GET /repos/:owner/:repo only includes the .permissions object when queried by a user/OAuth token. For the workflow's GITHUB_TOKEN, the field is absent, so .permissions.push // false resolves to "false" and the script bails — even though the publish-release job declares contents: write and 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 subsequent git push origin $tag, git push origin gh-pages --force, or gh release create calls. Local runs still get the probe.

Recovery

Once this merges, re-run Publish Release (workflow_dispatch on main) to publish 4.14.0. script/publish is idempotent for the tag creation, so a partial prior run doesn't block a retry.

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
@joelhawksley
joelhawksley merged commit b7094df into main Aug 24, 2026
22 of 24 checks passed
@joelhawksley
joelhawksley deleted the joelhawksley-redesigned-sniffle branch August 24, 2026 20:00
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.

1 participant