-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix: add labeler action #4213
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: add labeler action #4213
Conversation
labeler: | ||
permissions: | ||
contents: read | ||
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.
This is general "write" permissions to the repository, or is there something more granular for applying labels only? 😓
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.
So this is interesting.
Pull requests are a type of issue. Any actions that are available in both pull requests and issues, like managing assignees, labels, and milestones, are provided by the REST API to manage issues
Then I found this:
https://github.com/orgs/community/discussions/13565#discussioncomment-4915757
So we can only get to issues: write
which I suppose has a smaller blast radius but that's as much granularity as we can currently get out of GH. I am not sure it's worth changing. Is it?
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.
Hmm good one. If that works for both issues and PRs, perhaps we should?
I knew issues and PRs were the same behind the scenes; there's even an API to convert an issue to a PR! (or at least, there used to be one)
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.
Oh, or is changing that widening the scope? (currently only label PR's but with that change both issues and PRs?)
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.
I feel like it's widening the scope but on things that may be less harmful per see i.e. full write scope on PR can change the code in the PR (if compromised) but the full issue scope can't, though it can change anything in issues.
Dunno, seems like a bit of a stalemate and we'll have to make a compromise
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.
Yeah, my concern is indeed about the code (git repository). Widening scope to both issues and PRs is fine, but if one of those options means "but don't allow write access to the git repository", that's what I'd like.
@crazy-max any recommendations?
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.
This is fine as long as we don't "Checkout" the repository and/or don't do any git operations which is the case with actions/labeler
. We have done the same with @dvdksn, see docker/docs#18738
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.
PTAL @thaJeztah 😄
.github/workflows/label.yaml
Outdated
branches: | ||
- "main" |
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.
Not needed
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.
removed 😄
Can you combine the changes to the new file in a single commit? |
Whilst we had added labeles to GHA config, we forgot to add the actual action doing the labeling. Co-authored-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
41a6836
to
ea02d9c
Compare
Just reabsed @thaJeztah PTAL |
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.
LGTM
PTAL @Jamstah @wy65701436 |
Whilst in #4205 we added labels to GHA config, we forgot to add the actual action doing the labelling 🤦♂️
We are also adding a label for
area/cache
This PR fixes that. PTAL @thaJeztah