From e9d5c0e429b7777c8f51ed515242e38bc36d377c Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 9 Nov 2023 16:23:29 +0100 Subject: [PATCH 1/3] GH Actions: rename label management workflow ... to allow for additional label management workflows. --- .../workflows/{manage-labels.yml => label-remove-outdated.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{manage-labels.yml => label-remove-outdated.yml} (100%) diff --git a/.github/workflows/manage-labels.yml b/.github/workflows/label-remove-outdated.yml similarity index 100% rename from .github/workflows/manage-labels.yml rename to .github/workflows/label-remove-outdated.yml From c11abf40d81e03d337c06d23ba7736ea55dcd305 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 9 Nov 2023 16:24:38 +0100 Subject: [PATCH 2/3] GH Actions: add workflow to label PRs which are in a conflict state Came across this action and sounded like an interesting and helpful one. Let's give it a try. Ref: https://github.com/mschilde/auto-label-merge-conflicts --- .github/workflows/label-merge-conflicts.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/label-merge-conflicts.yml diff --git a/.github/workflows/label-merge-conflicts.yml b/.github/workflows/label-merge-conflicts.yml new file mode 100644 index 0000000000..28f0ecf8d2 --- /dev/null +++ b/.github/workflows/label-merge-conflicts.yml @@ -0,0 +1,19 @@ +name: Check PRs for merge conflicts + +on: + push: + branches: + - master + +jobs: + check-prs: + runs-on: ubuntu-latest + if: github.repository_owner == 'PHPCSStandards' + + name: Check PRs for merge conflicts + + steps: + - uses: mschilde/auto-label-merge-conflicts@master + with: + CONFLICT_LABEL_NAME: "Status: has merge conflict" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 0c6e0b42c1d79afd97e98add4f8aae106eb79c2a Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 9 Nov 2023 16:26:54 +0100 Subject: [PATCH 3/3] 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 | 17 ++++++ 3 files changed, 101 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'] ---- -