mirror of
https://github.com/RGBCube/serenity
synced 2025-07-29 20:47:34 +00:00
CI: Automatically apply pull request labels for generic PR actions
Generic PR actions include opening a PR, submit review comments, adding new commits, etc. This prevents the reviewer and PR submitter from having to manually bounce the labels back and forth in the general case. The reviewer also may not have permission to set labels, meaning the reviewer won't be able to update the labels accordingly themselves. This does not handle more subjective labels such as pr-is-blocked and pr-unclear. Unfortunately, there does not seem to be a GitHub Actions trigger for when a PR has merge conflicts, so the pr-has-conflicts label cannot be automatically applied. Co-authored-by: kleines Filmröllchen <filmroellchen@serenityos.org>
This commit is contained in:
parent
3332ce01ce
commit
a6716e694d
2 changed files with 171 additions and 0 deletions
26
.github/workflows/label-pull-requests.yml
vendored
Normal file
26
.github/workflows/label-pull-requests.yml
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
name: Pull request labeler
|
||||
|
||||
# FIXME: Consider adding the `issue_comment` event to change labels based on generic, non-review pull request comments.
|
||||
# Consider the trade off of how spammy it can be (one CI run per comment) and how useful it would be to have.
|
||||
# Consider alternatives to `issue_comment`.
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, reopened, converted_to_draft, ready_for_review, synchronize, edited, review_requested, closed]
|
||||
pull_request_review:
|
||||
types: [submitted, edited, dismissed]
|
||||
|
||||
jobs:
|
||||
label_pull_request:
|
||||
runs-on: ubuntu-22.04
|
||||
if: always() && github.repository == 'SerenityOS/serenity'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Label pull request
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.BUGGIEBOT_TOKEN }}
|
||||
script: |
|
||||
const script = require('./Meta/label-pull-requests.js')
|
||||
script({github, context})
|
Loading…
Add table
Add a link
Reference in a new issue