openai / openai/codex

GitHub Connector: repository/PR/file reads work, but refs, commits, compare and workflow runs return 403

Open
#39,018 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auth bug codex-web
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What issue are you seeing?

The GitHub Connector has selective read-access failures on a private repository under a GitHub organization.

The connector is successfully authenticated and can perform several READ-ONLY operations against the same repository:

  • repository metadata retrieval works;
  • pull request metadata retrieval works;
  • repository contents/files retrieval works;
  • files from the default branch can be read.

However, other READ-ONLY GitHub operations consistently fail with:

403 Resource not accessible by integration

The failing operations include:

  • GET /repos/<org>/<private-repo>/git/ref/heads/main
  • fetching a known commit through the commits API
  • comparing two known commits through the compare API
  • retrieving workflow runs associated with a known commit

The GitHub App is installed, repository access is configured as All repositories, and the GitHub Connector has already been reconnected.

This does not appear to be a general repository authorization failure because metadata, PRs and file contents continue to work in the same repository.

No WRITE operation is required to reproduce the problem.

Sensitive repository names, tokens, secrets, installation IDs and internal commit identifiers have been intentionally redacted.

What steps can reproduce the bug?
  1. Connect ChatGPT/Codex to GitHub using the GitHub Connector.

  2. Install/authorize the GitHub App for a private repository under a GitHub organization.

  3. Configure repository access as All repositories.

  4. Confirm that repository metadata can be retrieved.

  5. Confirm that pull request metadata can be retrieved.

  6. Confirm that repository files can be read through the contents API.

  7. Perform a READ-ONLY request equivalent to:

    GET /repos/<org>/<private-repo>/git/ref/heads/main

  8. Observe:

    403 Resource not accessible by integration

  9. Fetch a known commit SHA through the commits API.

  10. Observe the same:

403 Resource not accessible by integration

  1. Compare two known commit SHAs through the GitHub compare API.

  2. Observe the same 403.

  3. Request GitHub Actions workflow runs associated with a known commit.

  4. This request has also returned:

403 Resource not accessible by integration

Reconnecting the GitHub Connector did not resolve the issue.

No branch modification, commit, merge, rebase, deployment or other WRITE operation is necessary to reproduce it.

What is the expected behavior?

The GitHub Connector should be able to perform the required READ-ONLY Git operations when the installed GitHub App has sufficient repository read access.

Since the same connector can already retrieve repository metadata, pull request metadata and repository contents, Git refs, commit retrieval and commit comparison should also work when covered by the granted GitHub App permissions.

If one of these endpoints requires an additional permission that is unavailable to the current installation token, the connector should return a clear diagnostic identifying the missing permission rather than only:

Resource not accessible by integration

Additional information

This issue blocks a safe Git rebaseline audit.

The connector can inspect the pull request, its changed files and the production code involved, but it cannot authoritatively verify:

  • the current HEAD of main;
  • ahead/behind status;
  • the official commit comparison;
  • the current branch-to-main relationship.

Our engineering workflow intentionally operates fail-closed, so WRITE operations cannot proceed until the Git graph is independently verified.

This report is NOT requesting broad or unrestricted GitHub permissions. The goal is to have the connector correctly use the minimum permissions required for these READ-ONLY operations, or clearly report which permission is missing.

Troubleshooting already performed:

  • GitHub Connector connection confirmed;
  • GitHub App installation confirmed;
  • private repository access confirmed;
  • All repositories configured;
  • connector reconnection performed;
  • repository metadata re-tested successfully;
  • PR metadata re-tested successfully;
  • repository contents re-tested successfully;
  • Git refs re-tested and still return 403;
  • commit retrieval re-tested and still returns 403;
  • commit comparison re-tested and still returns 403;
  • workflow-run retrieval has also returned 403.

Potentially related reports:

  • openai/codex#21387
  • openai/codex#36042

Could the maintainers confirm whether repository contents, pull request metadata, Git refs, commits, commit comparison and GitHub Actions requests currently use different installation-token permission paths inside the GitHub Connector?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the GitHub Connector request paths for the refs, commits, compare, and workflow-runs endpoints, then compare their installation-token permission handling with repository metadata, pull requests, and contents. Done means the supported read-only operations succeed with minimum required permissions, or failures identify the missing permission clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, rust
Domain
api, authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.