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

Add workflow scope to github.rb #10562

Closed
wants to merge 1 commit into from
Closed

Add workflow scope to github.rb #10562

wants to merge 1 commit into from

Conversation

mindfulmonk
Copy link
Contributor

I've recently tried bumping a cask version and got a recommendation to create a token with this message:

Or create a personal access token:
  https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew

As it was missing the workflow scope the bump failed.

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?
  • Have you successfully run brew man locally and committed any changes?

I've recently tried bumping a cask version and got a recommendation to create a token with this message:
```
Or create a personal access token:
  https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew
```
As it was missing the workflow scope the bump failed.
@nandahkrishna
Copy link
Member

Question because I'm unaware, but would the workflow scope be necessary to bump versions? From the docs:

Grants the ability to add and update GitHub Actions workflow files. Workflow files can be committed without this scope if the same file (with both the same path and contents) exists on another branch in the same repository. Workflow files can expose GITHUB_TOKEN which may have a different set of scopes, see https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token for details.

Hope this isn't from some incorrect error-handling added in #10490.

@mindfulmonk
Copy link
Contributor Author

I've got the following message, when I didn't have the workflow scope on the token:

To https://github.com/mindfulmonk/homebrew-cask.git
 ! [remote rejected]       bump-rekordbox-6.5.0-20210127201749 -> bump-rekordbox-6.5.0-20210127201749 (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/automerge.yml` without `workflow` scope)

@MikeMcQuaid
Copy link
Member

@mindfulmonk Please rebase this on origin/master; we had to change the CI configuration. Thanks!

@mindfulmonk mindfulmonk mentioned this pull request Feb 8, 2021
8 tasks
@mindfulmonk
Copy link
Contributor Author

Looks like I've hit isaacs/github#168 closing this in favour of #10568

@mindfulmonk mindfulmonk closed this Feb 8, 2021
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Mar 11, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Mar 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants