-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
feat: added permissions (pull-requests: read) setting to workflow and README example #215
Conversation
Hey @natterstefan, it's nice to see you here! 🙂 Thank you for your PR! There was some discussion on this in #182 (likely also #212 intended to be about this). I was previously a bit opposed to this since it requires more configuration, but maybe it can in fact be helpful for trading that with trustworthiness. Do you have examples of other actions which advertise the usage of permissions? Some considerations (unfortunately GitHub freezes today for me when I open the files tab, so I'll list the feedback here):
Thank you also for upgrading some action versions! Many thanks! 🙌 |
Good to see the addition of permissions, gives users a better understanding of what it needs to do the job. Would love to see this merged. |
Hi @stevenh, thanks for the reminder. I keep the tab open now, and I hope to get to this in the next few days. |
974f62b
to
3cdd34e
Compare
Hi @amannn,
I am not 100% sure which information I should add to the WIP part of the config in README.md. Can you explain this further to me, please?
I already linked to a Demo PR with test runs in the PR description.
I am not 100% sure why I've added |
The built-in support for Does this help? |
I got it. It makes sense, and thanks for the info. You see what I came up with for the Adding a |
README.md
Outdated
### Required Permissions for [WIP] feature | ||
|
||
If you want to use the `[WIP]` feature, you need to grant the | ||
`pull-requests: write` permission to the GitHub Action. This is because the | ||
action will update the status of the PR. | ||
|
||
```yml | ||
name: "Lint PR" | ||
|
||
# ... | ||
|
||
permissions: | ||
pull-requests: write | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good!
Maybe we can move the whole config option for wip
to this block, similar to what we've done with the legacy configuration below? I'm just worried that users stop reading at the wip
option above and don't notice that permissions need to be changed (even though it's the very next headline).
By doing this, we can make sure we're educating users about the required permissions as we're introducing the feature. Maybe you can reuse the description from above here and adjust the headline accordingly to match the whole section?
I just noticed the "Note that a second check will be reported if this is enabled." part is no longer valid, can you remove this as part of moving the text?
Thank you so much! 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks! I've included a commit with a few further README improvements that I had on my list to include them in the next release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much @natterstefan! 👏
You're welcome @amannn! 🤜🤛 |
🎉 This PR is included in version 5.3.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Changes
I see more and more actions taking care of managing the permissions of the
GITHUB_TOKEN,
which is why I added it to your example and the workflows (+ updated them to the latest version).The ones I added to
release,
andversioning
might need some changes once you merge them. I'm pretty sure that's all they need. As your action is widely used and growing, I think it's a good practice to help others get to know thepermissions
setting and take care of it in their workflows.Demo PR with Test Runs
Docs