The GitHub Actions runner failed to access a resource because the integration (your GitHub App or OAuth App) lacks the necessary permissions for that specific resource, usually due to scope misconfiguration or a missing webhook.

Here are the common causes and their fixes:

1. Incorrect Repository/Organization Permissions for the GitHub App/OAuth App

  • Diagnosis: Navigate to your GitHub App’s or OAuth App’s settings on GitHub. Go to "Configure" or "General" settings and check the "Permissions" section. Ensure the app has at least "Read" access to the repositories it needs to interact with. If it’s an organization-level app, verify its installation on the correct organization and that the repository access is granted broadly or to specific repositories. For OAuth Apps, check the scopes granted during the authorization flow.
  • Fix:
    • For GitHub Apps: Re-install the app on the correct repository or organization, ensuring you select "All repositories" or the specific repositories where your Actions workflow runs and needs access. If it’s already installed, you might need to update its permissions. Go to Settings > Install Apps on the repository or organization, find your app, and click "Configure." Adjust the repository access and permissions.
    • For OAuth Apps: The user who initially authorized the app might need to re-authorize it with broader permissions. This usually involves visiting the app’s authorization URL with updated scope parameters. For example, if you need repo scope, ensure it’s included.
  • Why it works: GitHub Apps and OAuth Apps act as identities. If this identity doesn’t have the fundamental permission to see or access the repository or organization, any integration attempting to operate within it will fail, regardless of workflow specifics.

2. Missing or Incorrect Webhook Configuration (for GitHub Apps)

  • Diagnosis: If your GitHub App relies on webhooks to receive events (e.g., for triggering workflows on specific pushes or pull requests), a misconfigured or missing webhook can cause the "resource not accessible" error. Check the "Webhooks" section in your GitHub App’s settings. Ensure there’s a webhook configured for the relevant events (e.g., push, pull_request) and that the content type is application/json. The Active toggle must be on.
  • Fix: Add or edit the webhook. The Payload URL should point to your webhook receiver (often a service like AWS Lambda, Azure Functions, or a custom server). Ensure the webhook is set to Active and that the correct Events are subscribed to. If you’re using a GitHub Actions webhook integration, ensure that integration is correctly configured.
  • Why it works: Many integrations, especially those that need to react to specific events before a workflow runs or to update statuses, rely on webhooks. If the webhook isn’t set up or isn’t receiving events, the integration might not have the context or authorization to proceed.

3. Insufficient Scopes for Specific API Operations

  • Diagnosis: The error might not be about accessing the repository itself, but a specific resource within it that requires a more granular permission. For example, if your workflow tries to manage GitHub Packages, it needs the packages scope. If it tries to manage deployments, it needs the deployments scope. Check the GitHub App’s or OAuth App’s permissions for these specific scopes.
  • Fix:
    • For GitHub Apps: Go to your app’s settings, click "Configure," and under "Permissions," grant the necessary granular permissions (e.g., "Read and Write" for packages, contents, deployments, etc.). Re-install or update the app’s permissions for the relevant repositories/organizations.
    • For OAuth Apps: The user who authorized the app needs to re-authorize it with the required scopes. You’ll typically need to construct a new authorization URL that includes the additional scopes.
  • Why it works: GitHub’s permission model is hierarchical. A broad repo scope allows reading/writing repository contents, but specific actions like managing packages or deployments require explicit, dedicated scopes.

4. Token Expiration or Revocation

  • Diagnosis: If your workflow is using a Personal Access Token (PAT) or a token generated by a GitHub App/OAuth App, it might have expired or been revoked. Check the token’s expiration date in your GitHub settings (Settings > Developer settings > Personal access tokens). If it’s a token generated by a GitHub App, ensure the app itself hasn’t been uninstalled or had its permissions revoked at the repository/organization level.
  • Fix:
    • For PATs: Generate a new PAT with the required scopes and update your GitHub Actions secrets.
    • For App/OAuth Tokens: Re-install the app or re-authorize the OAuth app with the correct permissions. If the token is being generated within a workflow (e.g., using GITHUB_TOKEN), ensure the workflow has the necessary permissions defined in its permissions block.
  • Why it works: Tokens are credentials. Like any credential, they have a lifecycle. Expired or revoked tokens are invalid, preventing any authenticated API calls.

5. Incorrect GITHUB_TOKEN Permissions

  • Diagnosis: The GITHUB_TOKEN is automatically generated for each workflow run. By default, it has limited permissions. If your workflow needs to perform actions that require broader access (e.g., pushing to a protected branch, creating releases), the default GITHUB_TOKEN permissions might be insufficient. Check the permissions block in your workflow YAML file.
  • Fix: Explicitly define the required permissions for GITHUB_TOKEN in your workflow file. For example:
    permissions:
      contents: write # Or read, or none
      packages: write
      pull-requests: write
    
    Then, re-run the workflow.
  • Why it works: The permissions block in the workflow explicitly grants the GITHUB_TOKEN the necessary access levels to interact with specific GitHub APIs. Without this, it defaults to read-only access for most resources.

6. Using a Service Account with Insufficient Privileges

  • Diagnosis: If your Actions workflow is interacting with external services (e.g., AWS, Azure, GCP) using a service account or identity that lacks the necessary IAM roles or permissions to access specific resources (like S3 buckets, Kubernetes clusters, or managed databases), you’ll see this error. The error message might be generic "resource not accessible," but the underlying cause is the external service’s authorization.
  • Fix:
    • AWS: Grant the IAM role assumed by your GitHub Actions runner (e.g., via OIDC) the necessary policies for the target AWS resource.
    • Azure: Assign the correct Role-Based Access Control (RBAC) roles to the managed identity used by your workflow.
    • GCP: Grant the service account used by your workflow the appropriate IAM roles for the target GCP resource.
  • Why it works: GitHub Actions often needs to interact with cloud providers or other external systems. The "resource not accessible" error can propagate from these external systems if the credentials or identities used by the runner don’t have permission to access the specific resource in that external system.

The next error you might encounter after fixing this is related to rate limiting if you’ve been aggressively retrying or if the underlying service has strict usage policies.

Want structured learning?

Take the full Github-actions course →