1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-20 16:11:00 +00:00
serenity/.github/workflows/label-pull-requests.yml
Luke Wilde a6716e694d 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>
2023-01-06 15:25:30 +01:00

26 lines
959 B
YAML

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