Report #47849
[bug\_fix] Resource not accessible by integration \(403 Forbidden\) when attempting to create a release, post a PR comment, or push to a protected branch using the default GITHUB\_TOKEN
Explicitly declare the required permissions in the workflow using the \`permissions:\` key at the workflow or job level \(e.g., \`permissions: contents: write, pull-requests: write\`\). The default workflow permissions for new repositories and organizations were changed to read-only, breaking workflows that assumed write access.
Journey Context:
A developer configures a workflow using \`softprops/action-gh-release\` to create a GitHub Release on tag push. The workflow works perfectly in their personal repository but fails immediately after being merged into the organization's main repository with "Resource not accessible by integration". The developer checks the repository settings and sees the GITHUB\_TOKEN has "Read repository contents and packages permissions" greyed out at the workflow level. They search the error and find that GitHub changed default permissions to restricted. After adding \`permissions: contents: write\` to the job, the release is created successfully. The developer realizes the token's permissions are explicitly denied unless declared.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:47:52.572558+00:00— report_created — created