Answers: <p>My problem was that the plugin was &quot;waiting admin approval&quot; which is <strong>something it never told me I needed when I created it</strong>.</p>
  <p>Here is a screen shot.
  <a href="https://i.sstatic.net/TybEAtJj.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TybEAtJj.png" alt="GitHub fine-grained token: waiting admin approval" /></a></p>
  <p>An admin approved it, and it worked.</p>
  
Answers: CC BY-SA 4.0
Answers: 2024-11-22T21:03:05.013Z
Answers: 2024-11-22T21:03:05.013Z
Answers: Evan Carroll
Body: <p>When I try to download a different repository within my organization using <code>actions/checkout@v4</code> and a fine-grained access token with &quot;Read access to code and metadata&quot;, I'm getting &quot;Write access to repository not granted.&quot;</p>
  <pre class="lang-none prettyprint-override"><code>##[group]Fetching the repository
  [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +refs/heads/production*:refs/remotes/origin/production* +refs/tags/production*:refs/tags/production*
  remote: Write access to repository not granted.
  ##[error]fatal: unable to access 'https://github.com/acme-integrations/myrepo/': The requested URL returned error: 403
  The process '/usr/bin/git' failed with exit code 128
  </code></pre>
  <p>Note the token is installed as a repo secret <code>GH_AUTH_TOKEN</code>, and I'm passing it in properly.</p>
  <p>actions/checkout@v4</p>
  <pre class="lang-yaml prettyprint-override"><code>- name: &quot;Checkout Deps: MyDeps&quot;
    uses: actions/checkout@v4
    with:
      repository: acme-integrations/myrepo
      ref: production
      path: foo/bar/baz
      token: ${{ secrets.GH_AUTH_TOKEN }}
  </code></pre>
  <p>My token has read-access to &quot;Contents&quot; and &quot;Meta-Contents&quot; it shouldn't need to write to anything to use <code>actions/checkout</code>,</p>
  <p><a href="https://i.sstatic.net/VqX4bKth.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/VqX4bKth.png" alt="Token Read Access" /></a></p>
  
Tags: <github><github-actions><github-enterprise>
Title: Using actions/checkout@v4: Write access to repository not granted
UserDisplayName: Evan Carroll
ThreadText: # Using actions/checkout@v4: Write access to repository not granted
  
  (Asked by: username_0 on 2024-11-22)
  
  When I try to download a different repository within my organization using `actions/checkout@v4` and a fine-grained access token with "Read access to code and metadata", I'm getting "Write access to repository not granted."
  
  ```none
  ##[group]Fetching the repository
  [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +refs/heads/production*:refs/remotes/origin/production* +refs/tags/production*:refs/tags/production*
  remote: Write access to repository not granted.
  ##[error]fatal: unable to access 'https://github.com/acme-integrations/myrepo/': The requested URL returned error: 403
  The process '/usr/bin/git' failed with exit code 128
  
  ```
  
  Note the token is installed as a repo secret `GH_AUTH_TOKEN`, and I'm passing it in properly.
  
  actions/checkout@v4
  
  ```yaml
  - name: "Checkout Deps: MyDeps"
    uses: actions/checkout@v4
    with:
      repository: acme-integrations/myrepo
      ref: production
      path: foo/bar/baz
      token: ${{ secrets.GH_AUTH_TOKEN }}
  
  ```
  
  My token has read-access to "Contents" and "Meta-Contents" it shouldn't need to write to anything to use `actions/checkout`,
  
  [![Token Read Access](https://i.sstatic.net/VqX4bKth.png)](https://i.sstatic.net/VqX4bKth.png)
  
  **Tags:** github, github-actions, github-enterprise
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2024-11-22. Score: 0 | Accepted answer
  
  My problem was that the plugin was "waiting admin approval" which is **something it never told me I needed when I created it**.
  
  Here is a screen shot.
  [![GitHub fine-grained token: waiting admin approval](https://i.sstatic.net/TybEAtJj.png)](https://i.sstatic.net/TybEAtJj.png)
  
  An admin approved it, and it worked.
  
  
  ---
  
  