From 8a2d9a2bd80c5b362bab4ff8a4610d6689496029 Mon Sep 17 00:00:00 2001 From: Rohan Sasne Date: Fri, 21 Jul 2023 08:25:57 -0500 Subject: [PATCH 1/3] Add PR Labeler TemplateDd --- .github/labeler.yml | 3 +++ .github/workflows/prlabeler.yml | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/prlabeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000000..0d44cdcf0f0 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,3 @@ +# +# Add project labels +# diff --git a/.github/workflows/prlabeler.yml b/.github/workflows/prlabeler.yml new file mode 100644 index 00000000000..59b672a06eb --- /dev/null +++ b/.github/workflows/prlabeler.yml @@ -0,0 +1,20 @@ +# This workflow is based on github action official label action v4. +# This workflow action is triggered on pull request event(on both fork & inside repo) +# Labels will be applied based on filepath modification in PR. +# This workflow uses a regex based labeling config file(.github/labeler.yml) to take labeling decision. + +name: "PR Labeler" +on: +- pull_request_target +jobs: + label: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + + steps: + - uses: actions/labeler@v4 + with: + configuration-path: ".github/labeler.yml" + sync-labels: false \ No newline at end of file From fedc6ceb166c0429cc4174738e74cddf31c5c76e Mon Sep 17 00:00:00 2001 From: Rohan Sasne Date: Fri, 21 Jul 2023 08:29:14 -0500 Subject: [PATCH 2/3] Add Labels to Directories --- .github/labeler.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/labeler.yml b/.github/labeler.yml index 0d44cdcf0f0..ccde67bca45 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,3 +1,32 @@ # # Add project labels # + +# Add 'Documentation' label to any changes in the documentation + +'Documentation': + - documentation/** + - *.md + +# Add 'Website' label to any changes in the web directory + +'Website': + - web/** + +# Add 'Base' label to any changes in the base directory + +'Base': + - base/** + +# Add 'Models' label to any changes in the models directory + +'Models': + - models/** + +# Add 'Modules' label to any changes in the modules directory + +'Modules': + - modules/** + +'GitHub Actions': + - .github/workflows/** \ No newline at end of file From 1663b148ce3b80008af2e1142a6ff75e639a9128 Mon Sep 17 00:00:00 2001 From: Rohan Sasne Date: Fri, 21 Jul 2023 09:11:18 -0500 Subject: [PATCH 3/3] fix PR file error --- .github/labeler.yml | 2 +- .github/workflows/prlabeler.yml | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index ccde67bca45..f4c40abd898 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -6,7 +6,7 @@ 'Documentation': - documentation/** - - *.md + - **.md # Add 'Website' label to any changes in the web directory diff --git a/.github/workflows/prlabeler.yml b/.github/workflows/prlabeler.yml index 59b672a06eb..742f601db0d 100644 --- a/.github/workflows/prlabeler.yml +++ b/.github/workflows/prlabeler.yml @@ -3,18 +3,20 @@ # Labels will be applied based on filepath modification in PR. # This workflow uses a regex based labeling config file(.github/labeler.yml) to take labeling decision. -name: "PR Labeler" +name: "Pull Request Labeler" on: - pull_request_target + jobs: - label: + triage: permissions: contents: read pull-requests: write runs-on: ubuntu-latest - steps: - - uses: actions/labeler@v4 + - name: work around https://github.com/actions/checkout/issues/766 + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + - uses: actions/checkout@v3 with: - configuration-path: ".github/labeler.yml" - sync-labels: false \ No newline at end of file + set-safe-directory: false + - uses: actions/labeler@v4 \ No newline at end of file