From d4c55e62e0d1d80edabe0a9dd7e4a4e5c28a65ad Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Sat, 22 Jul 2023 15:49:23 +0530 Subject: [PATCH 1/5] Add Labeler Github Action. --- .github/labeler.yml | 54 +++++++++++++++++++++++++++++++++++ .github/workflows/labeler.yml | 38 ++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100755 .github/labeler.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100755 index 0000000000000..c6b6a0da528cd --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,54 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# Pull Request Labeler Github Action Configuration: https://github.com/marketplace/actions/labeler + +trunk: + - '**' +INFRA: + - .asf.yaml + - .gitattributes + - .gitignore + - .github/** + - dev-support/** +BUILD: + - any: [ '/**/pom.xml' ] +COMMON: + - hadoop-common-project/** +HDFS: + - hadoop-hdfs-project/** +RBF: + - hadoop-hdfs-project/hadoop-hdfs-rbf/** +HDFS-NATIVE: + - hadoop-hdfs-project/hadoop-hdfs-native-client/** +YARN: + - hadoop-yarn-project/** +MAPREDUCE: + - hadoop-mapreduce-project/** +DISTCP: + - hadoop-tools/hadoop-distcp/** +TOOLS: + - hadoop-tools/** +AWS: + - hadoop-tools/hadoop-aws/** +ABFS: + - hadoop-tools/hadoop-azure/** +DYNAMOMETER: + - hadoop-tools/hadoop-dynamometer/** +MAVEN-PLUGINS: + - hadoop-maven-plugins/** diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000000000..81a8e053cc9b9 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,38 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +name: "Pull Request Labeler" +on: [ pull_request ] + +jobs: + triage: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - run: | + echo ${{ github.workspace }} + echo $GITHUB_WORKSPACE + - uses: actions/labeler@v4.3.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + sync-labels: true + configuration-path: .github/labeler.yml + dot: true \ No newline at end of file From 5e8e5702b3f2a5fa09dcd0578760a82b7a1e1db5 Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Sun, 23 Jul 2023 02:01:37 +0530 Subject: [PATCH 2/5] Address review comments. --- .github/labeler.yml | 7 +++++-- .github/workflows/labeler.yml | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index c6b6a0da528cd..a3fa437e0de2a 100755 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,4 +1,5 @@ # +# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information @@ -26,16 +27,18 @@ INFRA: - .gitignore - .github/** - dev-support/** + - start-build-env.sh BUILD: - - any: [ '/**/pom.xml' ] + - '**/pom.xml' COMMON: - hadoop-common-project/** HDFS: - hadoop-hdfs-project/** RBF: - hadoop-hdfs-project/hadoop-hdfs-rbf/** -HDFS-NATIVE: +NATIVE: - hadoop-hdfs-project/hadoop-hdfs-native-client/** + - hadoop-common-project/hadoop-common/src/main/native/** YARN: - hadoop-yarn-project/** MAPREDUCE: diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 81a8e053cc9b9..f8bcddaf622ca 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -27,9 +27,10 @@ jobs: contents: read pull-requests: write steps: - - run: | - echo ${{ github.workspace }} - echo $GITHUB_WORKSPACE + - uses: actions/checkout@v3 + with: + sparse-checkout: | + .github - uses: actions/labeler@v4.3.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} From 9d73853fcb3a522deb3b93bdb1acb95119b6e3e0 Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Sun, 23 Jul 2023 02:43:00 +0530 Subject: [PATCH 3/5] Change to pull_request_target. --- .github/workflows/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index f8bcddaf622ca..0e2b46c3455e4 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -18,7 +18,7 @@ # name: "Pull Request Labeler" -on: [ pull_request ] +on: [ pull_request_target ] jobs: triage: From a5337f3d7646bb5258193dd41ef29aa7601a79e0 Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Sun, 23 Jul 2023 02:44:25 +0530 Subject: [PATCH 4/5] Change to pull_request_target. --- .github/workflows/labeler.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 0e2b46c3455e4..c6204c5aea017 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -18,7 +18,8 @@ # name: "Pull Request Labeler" -on: [ pull_request_target ] +on: + - pull_request_target jobs: triage: From cfc89d2ea5a768eaed9b986efc638b6d3c686f94 Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Sun, 23 Jul 2023 02:56:25 +0530 Subject: [PATCH 5/5] Fix Permission. --- .github/workflows/labeler.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index c6204c5aea017..f85aff05dda67 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -18,15 +18,15 @@ # name: "Pull Request Labeler" -on: - - pull_request_target +on: pull_request_target + +permissions: + contents: read + pull-requests: write jobs: triage: runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write steps: - uses: actions/checkout@v3 with: