GoReleaserでハマったところ
GoでCLIを
GoReleaser を
main.goがルートディレクトリにない場合
リポジトリルートに main.go (package main) をレイアウトしてない.goreleaser.yaml
ファイルをルートディレクトリに
builds:
- main: ./path/to/cmddir
403 Resource not accessible でこける
publishing
• scm releases
• creating or updating release repo=bayashi/go-edge tag=v0.1.8
⨯ release failed after 17s error=scm releases: failed to publish artifacts: could not release: POST https://api.github.com/repos/bayashi/go-edge/releases: 403 Resource not accessible by integration []
Error: The process '/opt/hostedtoolcache/goreleaser-action/1.17.2/x64/goreleaser' failed with exit code 1
エラーメッセージは error=scm releases: failed to publish artifacts: could not release
で、 403 Resource not accessible
と
scm releases
というのは、
GoReleaserのドキュメント によると、secrets.GITHUB_TOKEN
の
しかし、リポジトリごとに PAT をsecrets.GITHUB_TOKEN
で
Workflow permissions
リポジトリの Settings > Actions > General とWorkflow permissions
の
おそらく、readRead and write permissions
の
ぱわー