-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci] add GitHub Action workflow to label PRs based on tools they touch #21751
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rogerluan
commented
Dec 22, 2023
rogerluan
commented
Dec 22, 2023
Comment on lines
3
to
4
pull_request: # Temporary, for testing while PR is still open | ||
# pull_request_target |
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.
Note to reviewers: please don't merge this PR with this code in. Before merging, we need to delete pull_request
and uncomment pull_request_target
.
See https://github.com/actions/labeler#notes-regarding-pull_request_target-event for more details
rogerluan
commented
Dec 24, 2023
lacostej
reviewed
Dec 28, 2023
Co-authored-by: Jerome Lacoste <jerome.lacoste@gmail.com>
lacostej
approved these changes
Dec 31, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validci/circleci
builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)Motivation and Context
We keep adding these labels manually, but only when a core contributor opens/reviews a PR. A handy tool that does this automatically for us, even before we review the PR, would be helpful!
Description
This workflow will automatically label PRs with e.g.
tool: fastlane_core
,type: ci
,tool: deliver
, etc. based on the directories that are being modified in the PR.I'm wondering if I forgot any obvious rule we should be adding? What are other files associated to the
type: ci
label? Are there other labels we could automate based on file patterns?Important
This automation will only kick in when PRs are open/reopened or a new commit is pushed to it. In other words, it won't update existing open PRs. We'd need to do this in a one-off basis somehow. I intend to rebase all open PRs so that should help adding labels to all PRs that don't have merge conflicts currently, otherwise, we could merge a GHA workflow that will be trigger on cron job and then remove it once it's run once. Lmk your thoughts on this 馃槆
Testing Steps
Check if it adds and removes the labels as promised, in this PR. Then, switch
pull_request
trigger topull_request_target
, so it works with forked PRs. Read this (https://github.com/actions/labeler#notes-regarding-pull_request_target-event) to understand why this switching is needed to test.Screenshots of tests observed in this PR:
Labels successfully added by the bot once everything was configured correctly:
Labels successfully removed when the code changed in those directories was removed:
Not sure if we should allow the bot to remove labels, see this comment of mine: #21751 (comment)