summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2022-12-09 12:10:09 +0100
committerDaan De Meyer <daan.j.demeyer@gmail.com>2022-12-09 15:37:43 +0100
commit52c602d4c6a744a1000f7bd8cc04a4c3a8a8ca9a (patch)
tree52a579614effb0b8fe9f979da1123302e296cdfb /.github
parent7aebbdcfa9445d16dc3f765a8ee61a6d7f1daf0f (diff)
downloadsystemd-52c602d4c6a744a1000f7bd8cc04a4c3a8a8ca9a.tar.gz
ci: Labeler improvements
- Mention "/please-review" in the contributing guide - Remove "needs-rebase" on push - Don't add "please-review" if a green label is set - Don't add please-review label to draft PRs - Add please-review when a PR moves out of draft
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/labeler.yml39
1 files changed, 29 insertions, 10 deletions
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
index b86d1ff769..c3b4040add 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler.yml
@@ -5,15 +5,17 @@
name: "Pull Request Labeler"
on:
-- pull_request_target
-- issue_comment
+ pull_request_target:
+ types: [opened, synchronize, reopened, ready_for_review]
+ issue_comment:
+ types: [created]
permissions:
contents: read
jobs:
triage:
- if: github.event.repository.name != 'systemd-security'
+ if: github.repository == 'systemd/systemd'
runs-on: ubuntu-latest
permissions:
pull-requests: write
@@ -26,25 +28,42 @@ jobs:
sync-labels: "" # This is a workaround for issue 18671
- uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0
- if: github.event_name == 'pull_request_target'
+ if: github.event_name == 'pull_request_target' && !github.event.pull_request.draft
with:
script: |
- await github.rest.issues.addLabels({
+ response = await github.rest.issues.listLabelsOnIssue({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
- labels: ["please-review"]
- })
+ });
+
+ good_to_merge = [
+ "good-to-merge/waiting-for-ci 👍",
+ "good-to-merge/after-next-release",
+ "good-to-merge/with-minor-suggestions",
+ "good-to-merge/waiting-for-reporter-feedback 👍",
+ ];
+
+ if (response.data.every(l => !good_to_merge.includes(l.name))) {
+ await github.rest.issues.addLabels({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ labels: ["please-review"]
+ });
+ }
+
for (const label of ["reviewed/needs-rework 🔨",
"ci-fails/needs-rework 🔥",
- "ci-failure-appears-unrelated"]) {
+ "ci-failure-appears-unrelated",
+ "needs-rebase"]) {
try {
await github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: label,
- })
+ });
} catch (err) {
if (err.status != 404) {
throw err;
@@ -56,7 +75,7 @@ jobs:
if: github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/please-review')
with:
script: |
- github.rest.issues.addLabels({
+ await github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,