Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Fix CI permissions #436

Closed
rdimitrov opened this issue Dec 2, 2022 · 2 comments · Fixed by #437
Closed

Bug: Fix CI permissions #436

rdimitrov opened this issue Dec 2, 2022 · 2 comments · Fixed by #437
Labels
bug github_actions Pull requests that update GitHub Actions code good first issue

Comments

@rdimitrov
Copy link
Contributor

The default permissions of the GITHUB_TOKEN during GitHub Actions were changed this week for the whole organization.

In our case, Goreleaser depends on having write permissions if we want to publish releases to GitHub, so this affects our CI. To solve that we have to elevate the token permissions for the CI workflow.

Reference:

Invalid workflow file: .github/workflows/ci.yml#L12
The workflow is not valid. .github/workflows/ci.yml (Line: 12, Col: 3): Error calling workflow 'theupdateframework/go-tuf/.github/workflows/release.yml@c803c81'. The nested job 'release' is requesting 'contents: write', but is only allowed 'contents: read'.

@trishankatdatadog
Copy link
Member

In our case, Goreleaser depends on having write permissions if we want to publish releases to GitHub, so this affects our CI. To solve that we have to elevate the token permissions for the CI workflow.

Is it possible to override per repo?

@joshuagl
Copy link
Member

joshuagl commented Dec 5, 2022

You can just elevate permissions for the job that makes the release, i.e. https://github.com/theupdateframework/python-tuf/blob/7c756efe0084f20eb9de88665e9b299eb8a3d6b2/.github/workflows/cd.yml#L49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug github_actions Pull requests that update GitHub Actions code good first issue
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants