From e92056a2c8f500c36a71bcb5e4b37964a7778f10 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Sat, 21 Mar 2026 22:13:57 +0800 Subject: [PATCH 1/2] chore: add labeler action workflow --- .github/labeler.yml | 23 +++++++++++++++++++++++ .github/workflows/label-pr.yml | 21 +++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/label-pr.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 000000000000..380ff441c04a --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,23 @@ +# https://github.com/actions/labeler?tab=readme-ov-file#usage + +# Add the `4.8` label to PRs that target the `4.8` branch. +'4.8': # @todo change value whenever the next minor version is changed +- base-branch: '4.8' + +# Add the `github_actions` label to PRs that change any file in the `.github/workflows/` directory. +'github_actions': +- changed-files: + - any-glob-to-any-file: + - '.github/workflows/*' + +# Add the `documentation` label to PRs that change any file in the `user_guide_src/source/` directory. +'documentation': +- changed-files: + - any-glob-to-all-files: + - 'user_guide_src/source/*' + +# Add the `testing` label to PRs that change files in the `tests/` directory ONLY. +'testing': +- changed-files: + - any-glob-to-all-files: + - 'tests/*' diff --git a/.github/workflows/label-pr.yml b/.github/workflows/label-pr.yml new file mode 100644 index 000000000000..b0fca934797c --- /dev/null +++ b/.github/workflows/label-pr.yml @@ -0,0 +1,21 @@ +name: Add Labels to PRs + +# NOTE: When updating this workflow, you should first change the event to `pull_request` to test the changes +# in a PR, and then change it back to `pull_request_target` before merging. +# @see https://github.com/actions/labeler?tab=readme-ov-file#updating-major-version-of-the-labeler +on: + # to change to pull_request_target before merge; needs pull_request to test in PR + - pull_request + +jobs: + add-labels: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-24.04 + + steps: + - name: Add labels + uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1 + with: + sync-labels: true # Remove labels when matching files are reverted From c3cfa08c910c6c437a97736bf2898fd71bc5cee9 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Sun, 22 Mar 2026 02:30:24 +0800 Subject: [PATCH 2/2] chore: change event to `pull_request_target` right before merge --- .github/workflows/label-pr.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/label-pr.yml b/.github/workflows/label-pr.yml index b0fca934797c..730c98f271c1 100644 --- a/.github/workflows/label-pr.yml +++ b/.github/workflows/label-pr.yml @@ -4,8 +4,7 @@ name: Add Labels to PRs # in a PR, and then change it back to `pull_request_target` before merging. # @see https://github.com/actions/labeler?tab=readme-ov-file#updating-major-version-of-the-labeler on: - # to change to pull_request_target before merge; needs pull_request to test in PR - - pull_request + - pull_request_target jobs: add-labels: