Report #57467
[bug\_fix] Resource not accessible by integration \(403\) or Authentication failed when creating releases, commenting on PRs, or pushing to packages using GITHUB\_TOKEN
Add an explicit \`permissions:\` block at the workflow or job level \(e.g., \`permissions: contents: write\`, \`pull-requests: write\`\) to grant the GITHUB\_TOKEN the required OAuth scopes, OR change the repository Settings > Actions > General > Workflow permissions to 'Read and write permissions'. Root cause: In February 2023, GitHub changed the default workflow permissions to read-only for new repositories and organizations; the GITHUB\_TOKEN now requires explicit permission declarations in the YAML to perform write operations.
Journey Context:
Developer maintains a library and has a workflow that creates GitHub Releases automatically when a tag is pushed. The workflow uses \`actions/create-release\` and has worked for years. Suddenly, new repositories in the organization start failing with 'Resource not accessible by integration' immediately when the release step runs. The developer verifies that \`GITHUB\_TOKEN\` is passed correctly and checks repository secrets—nothing appears changed. They suspect an API outage or a broken action version. After searching GitHub Community forums, they find a pinned post about the February 2023 security change where default workflow permissions became restrictive \(read-only\). Checking the repository settings, they see 'Workflow permissions' is set to 'Read repository contents and packages' \(the new secure default\). They add \`permissions: contents: write\` to the specific job in the workflow YAML. Upon pushing, the release step succeeds immediately. The fix works because the \`permissions\` key explicitly grants the GITHUB\_TOKEN the necessary OAuth scopes required to create releases, overriding the organization-level restrictive default.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:56:52.662073+00:00— report_created — created