From 5e3fc6c70ce2a7ac17293655315eb422bc6ea82f Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Wed, 3 Apr 2024 07:18:06 +0000 Subject: [PATCH 1/4] feat: support pull request labeler --- .github/labeler.yml | 4 ++++ .github/workflows/labeler.yml | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000000..e20c5ef09f1 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,4 @@ +# Add 'skip news' label to any changes of .pre-commit-config.yaml +'skip news': +- changed-files: + - any-glob-to-any-file: .pre-commit-config.yaml diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 00000000000..e57cd86e2b3 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,12 @@ +name: "Pull Request Labeler" +on: +- pull_request_target + +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 From 80da803db0a28f50a04d0341678c1ad18a01b3e7 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Wed, 3 Apr 2024 07:32:40 +0000 Subject: [PATCH 2/4] feat: add news fragment file --- .github/labeler.yml | 4 +++- news/12605.feature.rst | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 news/12605.feature.rst diff --git a/.github/labeler.yml b/.github/labeler.yml index e20c5ef09f1..68539804f6c 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,4 +1,6 @@ -# Add 'skip news' label to any changes of .pre-commit-config.yaml +# Add 'skip news' label for any changes by pre-commit ci. 'skip news': - changed-files: - any-glob-to-any-file: .pre-commit-config.yaml + - base-branch: ['main'] + - head-branch: ['pre-commit-ci-update-config'] diff --git a/news/12605.feature.rst b/news/12605.feature.rst new file mode 100644 index 00000000000..ac0d8284ec6 --- /dev/null +++ b/news/12605.feature.rst @@ -0,0 +1 @@ +Automatically add ``skip news`` label to the pull request by pre-commit ci. From c6b6cbfd217af6a08927309905bc7404ad4b99fb Mon Sep 17 00:00:00 2001 From: Peter Shen Date: Wed, 3 Apr 2024 15:38:22 +0800 Subject: [PATCH 3/4] Update 12605.feature.rst --- news/12605.feature.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/12605.feature.rst b/news/12605.feature.rst index ac0d8284ec6..d629053e577 100644 --- a/news/12605.feature.rst +++ b/news/12605.feature.rst @@ -1 +1 @@ -Automatically add ``skip news`` label to the pull request by pre-commit ci. +Automatically add ``skip news`` label to the pull request created by pre-commit ci. From 934341ebd01efee61de6adeee269920d064da5ef Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Wed, 3 Apr 2024 23:18:29 +0800 Subject: [PATCH 4/4] fix: update trivial news file --- .github/labeler.yml | 3 ++- news/{12605.feature.rst => 12605.trivial.rst} | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename news/{12605.feature.rst => 12605.trivial.rst} (100%) diff --git a/.github/labeler.yml b/.github/labeler.yml index 68539804f6c..83332f7b8f5 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,4 +1,5 @@ -# Add 'skip news' label for any changes by pre-commit ci. +# Add 'skip news' label for any changes created by pre-commit ci. +# If https://github.com/actions/labeler/pull/563 is merged, we can check author pre-commit-ci. 'skip news': - changed-files: - any-glob-to-any-file: .pre-commit-config.yaml diff --git a/news/12605.feature.rst b/news/12605.trivial.rst similarity index 100% rename from news/12605.feature.rst rename to news/12605.trivial.rst