From f9be1998837ec3f20c87cfd23bd1293d85e7e1e7 Mon Sep 17 00:00:00 2001 From: Hundrec Date: Fri, 24 Jan 2025 16:29:22 -0700 Subject: [PATCH 1/8] Add `status: pending triage` to all PRs --- .github/labeler.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/labeler.yml b/.github/labeler.yml index 414df5a31e..18db4383bc 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -16,3 +16,8 @@ - any-glob-to-any-file: - github/* - '**/*.yml' + +# Add pending triage label to all PR's +'status: pending triage': +- changed-files: + - any-glob-to-any-file: '**' From 40b52be259a1299bbf25be08a8652bb72c96d0e8 Mon Sep 17 00:00:00 2001 From: Abnormal <86753001+AbnormalPoof@users.noreply.github.com> Date: Sat, 25 Jan 2025 20:25:14 +0000 Subject: [PATCH 2/8] Update label-pull-request.yml --- .github/workflows/label-pull-request.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/label-pull-request.yml b/.github/workflows/label-pull-request.yml index 525e1b5a65..15f4b6c199 100644 --- a/.github/workflows/label-pull-request.yml +++ b/.github/workflows/label-pull-request.yml @@ -1,6 +1,8 @@ name: "Pull Request Labeler" on: -- pull_request_target + pull_request_target: + types: + - opened jobs: # Apply labels to pull requests based on which files were edited From e5f477dd39891098554119971370231560430b00 Mon Sep 17 00:00:00 2001 From: Abnormal <86753001+AbnormalPoof@users.noreply.github.com> Date: Sun, 26 Jan 2025 04:13:52 +0000 Subject: [PATCH 3/8] now size and pr labels can be updated every commit! --- .github/workflows/label-pull-request.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/label-pull-request.yml b/.github/workflows/label-pull-request.yml index 15f4b6c199..147a0485d8 100644 --- a/.github/workflows/label-pull-request.yml +++ b/.github/workflows/label-pull-request.yml @@ -1,8 +1,6 @@ name: "Pull Request Labeler" on: - pull_request_target: - types: - - opened + - pull_request_target jobs: # Apply labels to pull requests based on which files were edited @@ -29,3 +27,18 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} configuration-path: .github/changed-lines-count-labeler.yml + # Apply `status: pending triage` to newly created pull requests + apply-pending-triage: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Apply "status pending triage" to new pull requests + # If there's no other `status` label, we can proceed! + if: | + ${{ !contains(github.event.pull_request.labels.*.name, 'status:') }} + uses: actions-ecosystem/action-add-labels@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + labels: "status: pending triage" From b45725d6aa93bcba6acfa321fcb3d94978e94bee Mon Sep 17 00:00:00 2001 From: Abnormal <86753001+AbnormalPoof@users.noreply.github.com> Date: Sun, 26 Jan 2025 04:27:08 +0000 Subject: [PATCH 4/8] remove this --- .github/workflows/label-pull-request.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/label-pull-request.yml b/.github/workflows/label-pull-request.yml index 147a0485d8..978f0e9d2e 100644 --- a/.github/workflows/label-pull-request.yml +++ b/.github/workflows/label-pull-request.yml @@ -27,18 +27,3 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} configuration-path: .github/changed-lines-count-labeler.yml - # Apply `status: pending triage` to newly created pull requests - apply-pending-triage: - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - steps: - - name: Apply "status pending triage" to new pull requests - # If there's no other `status` label, we can proceed! - if: | - ${{ !contains(github.event.pull_request.labels.*.name, 'status:') }} - uses: actions-ecosystem/action-add-labels@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - labels: "status: pending triage" From 10eb9f057477d766301ddf952dbbc7ee43b34b67 Mon Sep 17 00:00:00 2001 From: Abnormal <86753001+AbnormalPoof@users.noreply.github.com> Date: Sun, 26 Jan 2025 04:27:31 +0000 Subject: [PATCH 5/8] move the pending triage thing to a new workflow --- .github/workflows/label-pr-on-create.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/label-pr-on-create.yml diff --git a/.github/workflows/label-pr-on-create.yml b/.github/workflows/label-pr-on-create.yml new file mode 100644 index 0000000000..94620657d4 --- /dev/null +++ b/.github/workflows/label-pr-on-create.yml @@ -0,0 +1,19 @@ +name: "Pull Request Labeler 2 (Runs on PR creation)" +on: + pull_request_target: + types: + - opened + +jobs: + # Apply `status: pending triage` to newly created pull requests + apply-pending-triage: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Apply "status pending triage" to new pull requests + uses: actions-ecosystem/action-add-labels@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + labels: "status: pending triage" From ed8330dd4b28854c80e29a2d54381622a2a9d583 Mon Sep 17 00:00:00 2001 From: Abnormal <86753001+AbnormalPoof@users.noreply.github.com> Date: Sun, 26 Jan 2025 04:27:54 +0000 Subject: [PATCH 6/8] Rename label-pr-on-create.yml to label-pull-request-on-create.yml --- .../{label-pr-on-create.yml => label-pull-request-on-create.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{label-pr-on-create.yml => label-pull-request-on-create.yml} (100%) diff --git a/.github/workflows/label-pr-on-create.yml b/.github/workflows/label-pull-request-on-create.yml similarity index 100% rename from .github/workflows/label-pr-on-create.yml rename to .github/workflows/label-pull-request-on-create.yml From 197e6d56f7a915d6f0035881a68d5247d59ba2de Mon Sep 17 00:00:00 2001 From: Abnormal <86753001+AbnormalPoof@users.noreply.github.com> Date: Sun, 26 Jan 2025 04:34:02 +0000 Subject: [PATCH 7/8] fix the identation on this --- .github/workflows/label-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/label-pull-request.yml b/.github/workflows/label-pull-request.yml index 978f0e9d2e..525e1b5a65 100644 --- a/.github/workflows/label-pull-request.yml +++ b/.github/workflows/label-pull-request.yml @@ -1,6 +1,6 @@ name: "Pull Request Labeler" on: - - pull_request_target +- pull_request_target jobs: # Apply labels to pull requests based on which files were edited From 95b8921936b231e4a0b48d6174b16bc866f0852c Mon Sep 17 00:00:00 2001 From: Abnormal <86753001+AbnormalPoof@users.noreply.github.com> Date: Sun, 26 Jan 2025 04:36:23 +0000 Subject: [PATCH 8/8] almost forgot to remove this --- .github/labeler.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 18db4383bc..414df5a31e 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -16,8 +16,3 @@ - any-glob-to-any-file: - github/* - '**/*.yml' - -# Add pending triage label to all PR's -'status: pending triage': -- changed-files: - - any-glob-to-any-file: '**'