github.com/goreleaser/goreleaser@v1.25.1/www/docs/errors/multiple-tokens.md (about) 1 # Multiple tokens found, but only one is allowed 2 3 GoReleaser infers if you are using GitHub, GitLab or Gitea by which tokens are provided. 4 If you have multiple tokens set, you'll get this error. 5 6 Here's an example: 7 8 ```sh 9 тип release failed after 0.02s error=gmultiple tokens found, but only one is allowed: GITHUB_TOKEN, GITLAB_TOKEN 10 11 Learn more at https://goreleaser.com/errors/multiple-tokens 12 ``` 13 14 In this case, you either unset `GITHUB_TOKEN` or `GITLAB_TOKEN`. 15 You can read more about it in the [SCM docs](/scm/github/). 16 17 This can also happen if you load the tokens from files. 18 The default paths are: 19 20 - `~/.config/goreleaser/github_token` 21 - `~/.config/goreleaser/gitlab_token` 22 - `~/.config/goreleaser/gitea_token` 23 24 If you have more than one of these files, but for a particular project, you want 25 to force one of them, you can explicitly disable the others by setting them to a 26 file you know won't exist: 27 28 ```yaml 29 # .goreleaser.yaml 30 env_files: 31 gitlab_token: ~/nope 32 gitea_token: ~/nope 33 ``` 34 35 This will prevent using both GitLab and Gitea tokens. 36 37 ## Forcing a specific token 38 39 > Since: v1.17 40 41 If GoReleaser is being run with more than one of the `*_TOKEN` environment 42 variables and you can't unset any of them, you can force GoReleaser to use a 43 specific one by exporting a `GORELEASER_FORCE_TOKEN` environment variable. 44 45 So, for instance, if you have both `GITHUB_TOKEN` and `GITEA_TOKEN` set and want 46 GoReleaser to pick `GITEA_TOKEN`, you can set `GORELEASER_FORCE_TOKEN=gitea`. 47 GoReleaser will then unset `GITHUB_TOKEN` and proceed. 48 49 You can also force a token by using `force_token` in your config: 50 51 ```yaml 52 # .goreleaser.yaml 53 force_token: gitea 54 ``` 55