cicd permissions ai_generated true

Error: Resource not accessible by integration (403)

ID: cicd/gha-permission-denied

Also available as: JSON · Markdown
90%Fix Rate
91%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
any active

Root Cause

GitHub Actions workflow lacks required permissions to access repository resources such as packages, issues, pull requests, or deployments. The GITHUB_TOKEN has insufficient scopes.

generic

Workarounds

  1. 92% success Add explicit permissions block to the workflow with only the required scopes
    Add 'permissions:' at the job or workflow level with specific scopes like 'contents: read', 'packages: write', 'pull-requests: write' as needed
  2. 88% success Check and update organization/repository default workflow permissions
    Go to Settings > Actions > General > Workflow permissions and ensure 'Read and write permissions' is selected, or grant specific permissions

Dead Ends

Common approaches that don't work:

  1. Use a personal access token (PAT) with full repo scope as a workaround 50% fail

    Over-privileged tokens create security risks and PATs can expire, causing future failures; the root cause is incorrect workflow permissions

  2. Set all permissions to write without understanding which are needed 55% fail

    Violates principle of least privilege and may be blocked by organization-level permission policies

Error Chain

Leads to:
Preceded by:
Frequently confused with: