From f2411a7b11b558c4379b9df72ffc1ba1f2339be2 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 9 Nov 2023 16:26:54 +0100 Subject: [PATCH] GH Actions: auto-label new PRs Turns out the PR template does not allow for frontmatter which would set a label on new PRs. As I'd prefer all new (non-draft) PRs to be marked with `Status: triage`, I went looking for an action which could do this and ended up with an action which can do a lot more. Again, let's give it a try and see how it goes. Ref: https://github.com/srvaroa/labeler --- .github/labeler.yml | 84 +++++++++++++++++++++++++++++ .github/pull_request_template.md | 4 -- .github/workflows/label-new-prs.yml | 16 ++++++ 3 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/label-new-prs.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..e02a50f167 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,84 @@ +version: 1 +appendOnly: true +labels: +- label: "Status: triage" + draft: False + author-can-merge: False + +- label: "Core Component: Config & Ruleset & CLI options" + draft: False + files: + - "src/Config.php$" +- label: "Core Component: Config & Ruleset & CLI options" + draft: False + files: + - "src/Ruleset.php$" +- label: "Core Component: File" + draft: False + files: + - "src/Files/.*" +- label: "Core Component: Fixer" + draft: False + files: + - "src/Fixer.php$" +- label: "Core Component: Reports" + draft: False + files: + - "src/Reports/.*" +- label: "Core Component: Tokenizer" + draft: False + files: + - "src/Tokenizers/.*" +- label: "Core Component: Utils" + draft: False + files: + - "src/Util/.*" + +- label: "Focus: Comments/Docblocks" + draft: False + files: + - "src/Standards/.*/Sniffs/Commenting/" +- label: "Focus: Fixer Conflicts" + draft: False + body: ".* fixer conflict.*" + +- label: "Standard: Generic" + draft: False + files: + - "src/Standards/Generic/.*" +- label: "Standard: MySource" + draft: False + files: + - "src/Standards/MySource/.*" +- label: "Standard: PEAR" + draft: False + files: + - "src/Standards/PEAR/.*" +- label: "Standard: PSR1" + draft: False + files: + - "src/Standards/PSR1/.*" +- label: "Standard: PSR2" + draft: False + files: + - "src/Standards/PSR2/.*" +- label: "Standard: PSR12" + draft: False + files: + - "src/Standards/PSR12/.*" +- label: "Standard: Squiz" + draft: False + files: + - "src/Standards/Squiz/.*" +- label: "Standard: Zend" + draft: False + files: + - "src/Standards/Zend/.*" + +- label: "Type: bug" + draft: False + body: ".* bug .*" +- label: "Type: documentation" + draft: False + files: + - "/Docs/[A-Za-z0-9-]*/.*Standard.xml$" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 8bbef3d7b5..49fe6a5cc9 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,7 +1,3 @@ ---- -labels: ['Status: triage'] ---- -