1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-21 21:07:19 +02:00
goreleaser/www/docs/errors/resource-not-accessible-by-integration.md
André Lademann 973dde6879
docs: update deprecated config documentation (#5243)
This pull request updates the documentation to reflect changes in the
`goreleaser-action` version and modifies the `.goreleaser.yaml`
configuration for better clarity.

Documentation updates:

*
[`www/docs/errors/resource-not-accessible-by-integration.md`](diffhunk://#diff-165fd8d8fb477ae98173556cce7fbd52eb9c5fca03b713c7c8d59bc96e46fe50L32-R32):
Updated the `goreleaser-action` version from `v4` to `v6` in the
workflow file examples.
[[1]](diffhunk://#diff-165fd8d8fb477ae98173556cce7fbd52eb9c5fca03b713c7c8d59bc96e46fe50L32-R32)
[[2]](diffhunk://#diff-165fd8d8fb477ae98173556cce7fbd52eb9c5fca03b713c7c8d59bc96e46fe50L49-R49)

Configuration changes:

*
[`www/docs/errors/resource-not-accessible-by-integration.md`](diffhunk://#diff-165fd8d8fb477ae98173556cce7fbd52eb9c5fca03b713c7c8d59bc96e46fe50L63-R63):
Changed the `.goreleaser.yaml` configuration to use `repository` instead
of `tap` for specifying the brew repository.
2024-11-04 14:12:48 -03:00

79 lines
1.9 KiB
Markdown

# Resource not accessible by integration
When using GitHub Actions, you might feel tempted to use the action-bound
`GITHUB_TOKEN`.
While it is a good practice, and should work for most cases, if your workflow
writes a file in another repository, you may see this error:
```sh
⨯ 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 []
```
Integrations that may cause this:
- Homebrew Tap
- Krew Plugins
- Scoop Manifests
- Nixpkgs
## Fixing it
You have basically two options:
### 1. Use a Personal Access Token (PAT) for the entire process
You can create a PAT and use it for the entire GoReleaser action run.
You'll need to add it as secret and pass it to the action, for instance:
```yaml
# .github/workflows/release.yaml
# ...
- uses: goreleaser/goreleaser-action@v6
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
# ...
```
### 2. Use a Personal Access Token (PAT) specifically for the integration
You can also create a PAT for each integration.
Let's see, for example, how it would look like for Homebrew Taps.
We would need to change the workflow file:
```yaml
# .github/workflows/release.yaml
# ...
- uses: goreleaser/goreleaser-action@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
# ...
```
And also the `.goreleaser.yaml` file:
```yaml
# .goreleaser.yaml
# ...
brews:
- name: myproject
repository:
owner: user
name: homebrew-tap
token: "{{ .Env.TAP_GITHUB_TOKEN }}"
# ...
```
## Learning more
Read the documentation for each topic:
- [GitHub](../scm/github.md)
- [GitHub Actions](../ci/actions.md)
- [Homebrew Tap](../customization/homebrew.md)
- [Krew Plugin Manifests](../customization/krew.md)
- [Scoop Manifests](../customization/scoop.md)