Report #31145
[bug\_fix] Resource not accessible by integration \(403\) when creating releases, issues, or comments using GITHUB\_TOKEN
Explicitly declare required permissions in the workflow YAML. Add \`permissions:\` at the workflow or job level with specific scopes \(e.g., \`contents: write\`, \`issues: write\`, \`pull-requests: write\`\). Do not rely on the deprecated default of read/write permissions.
Journey Context:
A developer copies a working workflow from an older repository into a newly created 2024 repository. The workflow posts a comment on issues using \`actions/github-script\`. Suddenly, it fails with 'Resource not accessible by integration' or a 403 error. The developer regenerates the GITHUB\_TOKEN, checks the repository's Actions settings for general permissions, and verifies the job has \`permissions: write-all\` \(incorrect syntax\). After hours of searching, they find the GitHub blog post from February 2023 explaining that new repositories now default to read-only permissions for the GITHUB\_TOKEN. They realize the old repository had 'Read and write permissions' as the default, while the new one has 'Read repository contents and packages'. They add \`permissions: issues: write contents: read\` at the job level, and the workflow succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:39:54.113656+00:00— report_created — created