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

fix: Fix workflow permissions #996

Merged
merged 1 commit into from
Nov 3, 2023
Merged

fix: Fix workflow permissions #996

merged 1 commit into from
Nov 3, 2023

Conversation

evansd
Copy link
Contributor

@evansd evansd commented Nov 3, 2023

According to the Github docs, a "permissive" Github token (which is what we have) has "package: write" permissions by default: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token

And also according the Github docs, if you explicitly specify any permission in the workflow flow then all permissions you haven't specified revert to none:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defining-access-for-the-github_token-scopes

This means that explictly including package: write as we were doing is not only unnecessary but prevents us having permission to push version tags, meaning that the tag-new-version action failed with:

Error: Resource not accessible by integration

Obviously Github's behaviour must have changed here because this did work successfully on 2023-08-01, which was when we last published a new version.

According to the Github docs, a "permissive" Github token (which is what
we have) has "package: write" permissions by default:
https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token

And also according the Github docs, if you explicitly specify _any_
permission in the workflow flow then all permissions you haven't
specified revert to `none`:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defining-access-for-the-github_token-scopes

This means that explictly including `package: write` as we were doing is
not only unnecessary but prevents us having permission to push version
tags, meaning that the `tag-new-version` action failed with:

    Error: Resource not accessible by integration

Obviously Github's behaviour must have changed here because this did
work successfully on 2023-08-01, which was when we last published a new
version.
@evansd evansd merged commit 1d0ef9f into main Nov 3, 2023
4 checks passed
@evansd evansd deleted the evansd/perms-fix branch November 3, 2023 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants