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] Using permissions key to set GITHUB_TOKEN when running the action #32

Open
sgibson91 opened this issue Aug 18, 2021 · 2 comments
Open
Labels
bug Something isn't working

Comments

@sgibson91
Copy link
Owner

Summary

At the minute, I pass a PAT with public_repo scope to test-this-pr-action which allows me to push a new branch to a repo I have write access to and leave a comment on the open PR.

I was playing around with setting the permissions of the GITHUB_TOKEN to see if I could grant it just enough to do the above instead of my account. The following permissions can create the branch and leave the comment:

permissions:
  contents: write
  pulls-requests: write

But seemingly with these permissions to push to a branch, does not seem to trigger the a separate action that is set to trigger on pushes to main and test-this-pr/** branches. Seems counter-intuitive to me!

I have been testing the action in this repo: https://github.com/binderhub-test-org/pr-test

Refs:

@sgibson91 sgibson91 added the bug Something isn't working label Aug 18, 2021
@sgibson91 sgibson91 added wontfix This will not be worked on and removed wontfix This will not be worked on labels Sep 30, 2021
@sgibson91
Copy link
Owner Author

This is something that could be permitted with the use of reusable workflows https://docs.github.com/en/actions/learn-github-actions/reusing-workflows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant