From 0a9964d5f21b492674ad17672d07a0a8063da685 Mon Sep 17 00:00:00 2001 From: efb4f5ff-1298-471a-8973-3d47447115dc <73130443+efb4f5ff-1298-471a-8973-3d47447115dc@users.noreply.github.com> Date: Thu, 14 Dec 2023 21:02:19 +0000 Subject: [PATCH 1/6] Update labeler.yml --- .github/labeler.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 6c7ebbb..82202d6 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,4 +1,3 @@ 'PR: waiting for review': - - '*' - - '.github/**/*' - - 'src/**/*' +- changed-files: + - any-glob-to-any-file: '**' From 30aeefeb1ac5c62fd0f23b4ef66c4de7649d2fce Mon Sep 17 00:00:00 2001 From: efb4f5ff-1298-471a-8973-3d47447115dc <73130443+efb4f5ff-1298-471a-8973-3d47447115dc@users.noreply.github.com> Date: Thu, 14 Dec 2023 21:04:13 +0000 Subject: [PATCH 2/6] Delete .github/workflows/dummy-conflicts.yml --- .github/workflows/dummy-conflicts.yml | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 .github/workflows/dummy-conflicts.yml diff --git a/.github/workflows/dummy-conflicts.yml b/.github/workflows/dummy-conflicts.yml deleted file mode 100644 index ed1fa3f..0000000 --- a/.github/workflows/dummy-conflicts.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: Dummy workflow for conflicts -on: - pull_request_review: - types: [submitted] -jobs: - dummy: - runs-on: ubuntu-latest - steps: - - run: echo "this is a dummy workflow that triggers a workflow_run; it's necessary because otherwise the repo secrets will not be in scope for externally forked pull requests" From 4e6e30660315687d6d260f8310bc005e884d29a7 Mon Sep 17 00:00:00 2001 From: efb4f5ff-1298-471a-8973-3d47447115dc <73130443+efb4f5ff-1298-471a-8973-3d47447115dc@users.noreply.github.com> Date: Thu, 14 Dec 2023 21:04:45 +0000 Subject: [PATCH 3/6] Update conflicts.yml --- .github/workflows/conflicts.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/conflicts.yml b/.github/workflows/conflicts.yml index 63b208e..b2c6403 100644 --- a/.github/workflows/conflicts.yml +++ b/.github/workflows/conflicts.yml @@ -7,9 +7,6 @@ on: # In `pull_request` we wouldn't be able to change labels of fork PRs pull_request_target: types: [synchronize] - workflow_run: - workflows: ['Dummy workflow for conflicts'] - types: [requested] jobs: main: From 6098c3bc0387f4bd5983baf3613759ebc371615e Mon Sep 17 00:00:00 2001 From: efb4f5ff-1298-471a-8973-3d47447115dc <73130443+efb4f5ff-1298-471a-8973-3d47447115dc@users.noreply.github.com> Date: Thu, 14 Dec 2023 21:06:16 +0000 Subject: [PATCH 4/6] Update remove-outdated-labels.yml --- .github/workflows/remove-outdated-labels.yml | 31 ++++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/remove-outdated-labels.yml b/.github/workflows/remove-outdated-labels.yml index 722218c..00347d7 100644 --- a/.github/workflows/remove-outdated-labels.yml +++ b/.github/workflows/remove-outdated-labels.yml @@ -1,9 +1,10 @@ name: Remove outdated labels on: - # https://github.community/t/github-actions-are-severely-limited-on-prs/18179/15 pull_request_target: types: - closed + - converted_to_draft + - ready_for_review jobs: remove-merged-pr-labels: name: Remove merged pull request labels @@ -19,10 +20,11 @@ jobs: PR: changes requested PR: merge conflicts / rebase needed PR/Issue: dependent + PR: stale remove-closed-pr-labels: name: Remove closed pull request labels - if: github.event_name == 'pull_request_target' && (! github.event.pull_request.merged) + if: github.event_name == 'pull_request_target' && (! github.event.pull_request.merged) && (github.event.action != 'converted_to_draft') && (github.event.action != 'ready_for_review') runs-on: ubuntu-latest steps: - uses: mondeja/remove-labels-gh-action@v1.1.1 @@ -33,4 +35,27 @@ jobs: PR: WIP PR: changes requested PR: merge conflicts / rebase needed - PR/Issue: dependent + PR/Issue: dependent + PR: stale + + remove-draft-pr-labels: + name: Remove labels from draft pull requests + if: github.event_name == 'pull_request_target' && github.event.action == 'converted_to_draft' + runs-on: ubuntu-latest + steps: + - uses: mondeja/remove-labels-gh-action@v1.1.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + labels: | + PR: waiting for review + + remove-ready-pr-labels: + name: Remove labels when draft pr is marked ready for review + if: github.event_name == 'pull_request_target' && github.event.action == 'ready_for_review' + runs-on: ubuntu-latest + steps: + - uses: mondeja/remove-labels-gh-action@v1.1.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + labels: | + PR: WIP From 524247d2f81e14687e3b8c13e3edceb12da33a55 Mon Sep 17 00:00:00 2001 From: efb4f5ff-1298-471a-8973-3d47447115dc <73130443+efb4f5ff-1298-471a-8973-3d47447115dc@users.noreply.github.com> Date: Thu, 14 Dec 2023 21:18:29 +0000 Subject: [PATCH 5/6] Rename labeler.yml to pr-labeler.yml --- .github/{labeler.yml => pr-labeler.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{labeler.yml => pr-labeler.yml} (100%) diff --git a/.github/labeler.yml b/.github/pr-labeler.yml similarity index 100% rename from .github/labeler.yml rename to .github/pr-labeler.yml From 2813803b821d23160c73c498f211bc2e0660544d Mon Sep 17 00:00:00 2001 From: efb4f5ff-1298-471a-8973-3d47447115dc <73130443+efb4f5ff-1298-471a-8973-3d47447115dc@users.noreply.github.com> Date: Thu, 14 Dec 2023 21:22:46 +0000 Subject: [PATCH 6/6] Update label-pr.yml --- .github/workflows/label-pr.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/label-pr.yml b/.github/workflows/label-pr.yml index 492a3ab..5c9c992 100644 --- a/.github/workflows/label-pr.yml +++ b/.github/workflows/label-pr.yml @@ -1,7 +1,7 @@ name: "Pull Request Labeler" on: pull_request_target: - types: [opened, reopened] + types: [opened, reopened, ready_for_review] jobs: triage: @@ -9,7 +9,9 @@ jobs: contents: read pull-requests: write runs-on: ubuntu-latest + if: ${{ !github.event.pull_request.draft }} steps: - - uses: actions/labeler@v4 + - uses: actions/labeler@v5 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/pr-labeler.yml