Report #8867
[bug\_fix] Resource not accessible by integration \(403\) when creating release or pushing package
Add explicit \`permissions: contents: write\` \(or \`packages: write\`\) to the job or workflow level. The default \`GITHUB\_TOKEN\` permissions were changed to read-only for new repositories and organizations in February 2023, overriding the legacy permissive default.
Journey Context:
The workflow was working perfectly for months, then suddenly started failing with 403 Forbidden when attempting to POST to the GitHub Releases API or pushing to GHCR. Initial debugging checked the repository secrets—\`GITHUB\_TOKEN\` was present. Checked the job logs and noticed the token was being injected, but the API response indicated insufficient scope. Navigated to Settings > Actions > General > Workflow permissions and saw it was set to 'Read repository contents and packages permissions' \(the new default\). Realized that while the repository setting controls the default, the \`permissions\` key in the workflow YAML explicitly grants the necessary scopes regardless of the org default. Added \`permissions: contents: write\` to the specific job creating the release, which immediately resolved the 403 by elevating the temporary token's OAuth scopes for that job execution context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:42:14.817671+00:00— report_created — created