github.com/goreleaser/goreleaser@v1.25.1/www/docs/errors/resource-not-accessible-by-integration.md (about)

     1  # Resource not accessible by integration
     2  
     3  When using GitHub Actions, you might feel tempted to use the action-bound
     4  `GITHUB_TOKEN`.
     5  
     6  While it is a good practice, and should work for most cases, if your workflow
     7  writes a file in another repository, you may see this error:
     8  
     9  ```sh
    10     тип release failed after 430.85s error=homebrew tap formula: failed to publish artifacts: PUT https://api.github.com/repos/user/homebrew-tap/contents/Formula/scorecard.rb: 403 Resource not accessible by integration []
    11  ```
    12  
    13  Integrations that may cause this:
    14  
    15  - Homebrew Tap
    16  - Krew Plugins
    17  
    18  ## Fixing it
    19  
    20  You have basically two options:
    21  
    22  ### 1. Use a Personal Access Token (PAT) for the entire process
    23  
    24  You can create a PAT and use it for the entire GoReleaser action run.
    25  You'll need to add it as secret and pass it to the action, for instance:
    26  
    27  ```yaml
    28  # .github/workflows/goreleaser.yaml
    29  # ...
    30        - uses: goreleaser/goreleaser-action@v4
    31          env:
    32            GITHUB_TOKEN: ${{ secrets.GH_PAT }}
    33  # ...
    34  ```
    35  
    36  ### 2. Use a Personal Access Token (PAT) specifically for the integration
    37  
    38  You can also create a PAT for each integration.
    39  
    40  Let's see, for example, how it would look like for Homebrew Taps.
    41  
    42  We would need to change the workflow file:
    43  
    44  ```yaml
    45  # .github/workflows/goreleaser.yaml
    46  # ...
    47        - uses: goreleaser/goreleaser-action@v4
    48          env:
    49            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    50            TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
    51  # ...
    52  ```
    53  
    54  And also the `.goreleaser.yaml` file:
    55  
    56  ```yaml
    57  # .goreleaser.yaml
    58  # ...
    59  brews:
    60  - name: myproject
    61    tap:
    62      owner: user
    63      name: homebrew-tap
    64      token: "{{ .Env.TAP_GITHUB_TOKEN }}"
    65  # ...
    66  ```
    67  
    68  ## Learning more
    69  
    70  Read the documentation for each topic:
    71  
    72  - [GitHub](/scm/github/)
    73  - [GitHub Actions](/ci/actions/)
    74  - [Homebrew Tap](/customization/homebrew/)
    75  - [Krew Plugin Manifests](/customization/krew/)
    76  - [Scoop Manifests](/customization/scoop/)