Skip to content

Conversation

milosgajdos
Copy link
Member

@milosgajdos milosgajdos commented Dec 22, 2023

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

labeler:
permissions:
contents: read
pull-requests: write
Copy link
Member

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? 😓

Copy link
Member Author

@milosgajdos milosgajdos Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is interesting.

PR docs:

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?

Copy link
Member

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)

Copy link
Member

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?)

Copy link
Member Author

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

Copy link
Member

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?

Copy link
Contributor

@crazy-max crazy-max Dec 23, 2023

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL @thaJeztah 😄

Comment on lines 9 to 10
branches:
- "main"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed 😄

@thaJeztah
Copy link
Member

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>
@milosgajdos
Copy link
Member Author

Just reabsed @thaJeztah PTAL

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@milosgajdos
Copy link
Member Author

milosgajdos commented Jan 2, 2024

PTAL @Jamstah @wy65701436

@milosgajdos milosgajdos merged commit bf6f5c3 into distribution:main Jan 16, 2024
@milosgajdos milosgajdos deleted the add-labeler-action branch January 16, 2024 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants