Report #24881
[bug\_fix] HttpError: Resource not accessible by integration when creating release or commenting on PR
Add explicit permissions block at workflow or job level \(e.g., \`permissions: contents: write\` for releases, or \`permissions: pull-requests: write\` for commenting\) rather than relying on the repository default token permissions.
Journey Context:
A developer creates a workflow that posts a comment on pull requests using \`actions/github-script\` or creates a release using \`softprops/action-gh-release\`. The workflow works perfectly when tested on a branch within the repository. However, when a contributor opens a pull request from a fork, or when Dependabot creates a PR, the workflow fails with 'Resource not accessible by integration'. The developer checks the repository settings under Actions > General > Workflow permissions and sees it is set to 'Read repository contents and packages permissions' \(the default since February 2023\). They realize that the automatic token no longer has write permissions by default for security reasons. The fix is to explicitly declare the minimal required permissions \(e.g., \`permissions: pull-requests: write\`\) at the job level, which grants the GITHUB\_TOKEN the specific capability it needs without requiring a repository-wide setting change.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:10:30.968260+00:00— report_created — created