From adcb0aea67eef3e567252993f48adc23a3d0f37e Mon Sep 17 00:00:00 2001 From: vinlee19 <1401597760@qq.com> Date: Thu, 2 Jan 2025 19:20:27 +0800 Subject: [PATCH 01/14] add workflows (cherry picked from commit 7c54a178544cddae151269db67040b4cecc6eb75) --- .github/workflows/checkstyle.yaml | 36 ++++++++++++++++++++++++++++++ .github/workflows/license-eyes.yml | 36 ++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/checkstyle.yaml create mode 100644 .github/workflows/license-eyes.yml diff --git a/.github/workflows/checkstyle.yaml b/.github/workflows/checkstyle.yaml new file mode 100644 index 0000000..4ba2390 --- /dev/null +++ b/.github/workflows/checkstyle.yaml @@ -0,0 +1,36 @@ +# +# 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: License Check +on: + pull_request: + push: + branches: + - main +jobs: + license-check: + name: "License Check" + runs-on: ubuntu-latest + steps: + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" + uses: actions/checkout@v2 + - name: Check License + uses: apache/skywalking-eyes@v0.2.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/license-eyes.yml b/.github/workflows/license-eyes.yml new file mode 100644 index 0000000..23dbd5d --- /dev/null +++ b/.github/workflows/license-eyes.yml @@ -0,0 +1,36 @@ +# +#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: License Check +on: + pull_request: + push: + branches: + - main +jobs: + license-check: + name: "License Check" + runs-on: ubuntu-latest + steps: + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" + uses: actions/checkout@v2 + - name: Check License + uses: apache/skywalking-eyes@v0.2.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From cae1902568e122b75bf15b78959982913b196c76 Mon Sep 17 00:00:00 2001 From: vinlee19 <1401597760@qq.com> Date: Thu, 2 Jan 2025 19:22:37 +0800 Subject: [PATCH 02/14] modify ubuntu version (cherry picked from commit b3f0525f8d06eefa2cd10a44f6174655c59af16e) --- .github/workflows/checkstyle.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkstyle.yaml b/.github/workflows/checkstyle.yaml index 4ba2390..94f54b1 100644 --- a/.github/workflows/checkstyle.yaml +++ b/.github/workflows/checkstyle.yaml @@ -26,7 +26,7 @@ on: jobs: license-check: name: "License Check" - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@v2 From 484e2f6cc82ec36f3451bfbe90e01f64294a6cc7 Mon Sep 17 00:00:00 2001 From: vinlee19 <1401597760@qq.com> Date: Thu, 2 Jan 2025 19:30:07 +0800 Subject: [PATCH 03/14] test (cherry picked from commit 12eede031d4411cc26f426c50a8eec304d81204e) --- .github/workflows/checkstyle.yaml | 33 ++++++++++++++++++------------ .github/workflows/license-eyes.yml | 2 +- style/spotless-formatter.xml | 17 +++++++++++++++ 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/.github/workflows/checkstyle.yaml b/.github/workflows/checkstyle.yaml index 94f54b1..b9cddb2 100644 --- a/.github/workflows/checkstyle.yaml +++ b/.github/workflows/checkstyle.yaml @@ -1,4 +1,3 @@ -# # 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 @@ -17,20 +16,28 @@ # under the License. # --- -name: License Check +name: Code Style Checker + on: pull_request: - push: - branches: - - main + jobs: - license-check: - name: "License Check" + java-checkstyle: + name: "CheckStyle" runs-on: ubuntu-24.04 steps: - - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" - uses: actions/checkout@v2 - - name: Check License - uses: apache/skywalking-eyes@v0.2.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - name: Checkout + uses: actions/checkout@v3 + with: + persist-credentials: false + submodules: recursive + + - name: Setup java + uses: actions/setup-java@v2 + with: + distribution: adopt + java-version: '8' + + - name: Run java checkstyle + run: + cd flink-doris-redis && mvn clean compile checkstyle:checkstyle \ No newline at end of file diff --git a/.github/workflows/license-eyes.yml b/.github/workflows/license-eyes.yml index 23dbd5d..5cc6b4f 100644 --- a/.github/workflows/license-eyes.yml +++ b/.github/workflows/license-eyes.yml @@ -26,7 +26,7 @@ on: jobs: license-check: name: "License Check" - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@v2 diff --git a/style/spotless-formatter.xml b/style/spotless-formatter.xml index ae2631c..d730b94 100644 --- a/style/spotless-formatter.xml +++ b/style/spotless-formatter.xml @@ -1,5 +1,22 @@ + From bc8e9dd173617918221c5a313a4d09e87af23369 Mon Sep 17 00:00:00 2001 From: vinlee19 <1401597760@qq.com> Date: Thu, 2 Jan 2025 19:44:14 +0800 Subject: [PATCH 04/14] format code --- .github/workflows/license-eyes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/license-eyes.yml b/.github/workflows/license-eyes.yml index 5cc6b4f..5339680 100644 --- a/.github/workflows/license-eyes.yml +++ b/.github/workflows/license-eyes.yml @@ -22,7 +22,7 @@ on: pull_request: push: branches: - - main + - dev jobs: license-check: name: "License Check" From 715ce2bb59c8bcd94db80f71736a27a20a01f467 Mon Sep 17 00:00:00 2001 From: vinlee19 <1401597760@qq.com> Date: Thu, 2 Jan 2025 19:47:57 +0800 Subject: [PATCH 05/14] test checkstyle --- .../flink/streaming/connectors/redis/table/SQLExpireTest.java | 4 ++-- .../streaming/connectors/redis/table/SQLLettuceLimitTest.java | 2 +- .../connectors/redis/table/base/TestRedisConfigBase.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/apache/flink/streaming/connectors/redis/table/SQLExpireTest.java b/src/test/java/org/apache/flink/streaming/connectors/redis/table/SQLExpireTest.java index 3688b79..1b19529 100644 --- a/src/test/java/org/apache/flink/streaming/connectors/redis/table/SQLExpireTest.java +++ b/src/test/java/org/apache/flink/streaming/connectors/redis/table/SQLExpireTest.java @@ -44,7 +44,7 @@ public void testSinkValueWithExpire() throws Exception { String sink = "create table sink_redis(name varchar, level varchar, age varchar) with ( " - + sigleWith() + + singleWith() + "'ttl'='10', '" + REDIS_COMMAND + "'='" @@ -74,7 +74,7 @@ public void testSinkValueWithExpireOnKeyPresent() throws Exception { String dim = "create table sink_redis(name varchar, level varchar, age varchar) with ( " - + sigleWith() + + singleWith() + " 'ttl'='8', 'ttl.key.not.absent'='true', '" + REDIS_COMMAND + "'='" diff --git a/src/test/java/org/apache/flink/streaming/connectors/redis/table/SQLLettuceLimitTest.java b/src/test/java/org/apache/flink/streaming/connectors/redis/table/SQLLettuceLimitTest.java index 9c22adc..0495600 100644 --- a/src/test/java/org/apache/flink/streaming/connectors/redis/table/SQLLettuceLimitTest.java +++ b/src/test/java/org/apache/flink/streaming/connectors/redis/table/SQLLettuceLimitTest.java @@ -44,7 +44,7 @@ public void testSinkLimitLettucePool() throws Exception { String sink = "create table sink_redis(name varchar, level varchar, age varchar) with ( " - + sigleWith() + + singleWith() + "'ttl'='10', '" + REDIS_COMMAND + "'='" diff --git a/src/test/java/org/apache/flink/streaming/connectors/redis/table/base/TestRedisConfigBase.java b/src/test/java/org/apache/flink/streaming/connectors/redis/table/base/TestRedisConfigBase.java index 88f0ff5..df12fe3 100644 --- a/src/test/java/org/apache/flink/streaming/connectors/redis/table/base/TestRedisConfigBase.java +++ b/src/test/java/org/apache/flink/streaming/connectors/redis/table/base/TestRedisConfigBase.java @@ -63,7 +63,7 @@ public static void stopSingle() { redisClient.shutdown(); } - protected String sigleWith() { + protected String singleWith() { return "'connector'='redis', " + "'host'='" + REDIS_HOST From 53bf6965130cf9174d2e723db1a2431ea2f33172 Mon Sep 17 00:00:00 2001 From: vinlee19 <1401597760@qq.com> Date: Thu, 2 Jan 2025 19:50:52 +0800 Subject: [PATCH 06/14] code format checkstyle test --- .github/workflows/checkstyle.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/checkstyle.yaml b/.github/workflows/checkstyle.yaml index b9cddb2..eadfa0c 100644 --- a/.github/workflows/checkstyle.yaml +++ b/.github/workflows/checkstyle.yaml @@ -20,6 +20,9 @@ name: Code Style Checker on: pull_request: + push: + branches: + - dev jobs: java-checkstyle: From 3b60ec5d575fe55fbd133a538862ccc7091518c5 Mon Sep 17 00:00:00 2001 From: vinlee19 <1401597760@qq.com> Date: Thu, 2 Jan 2025 19:53:15 +0800 Subject: [PATCH 07/14] code format checkstyle test --- .github/workflows/checkstyle.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checkstyle.yaml b/.github/workflows/checkstyle.yaml index eadfa0c..f251d7c 100644 --- a/.github/workflows/checkstyle.yaml +++ b/.github/workflows/checkstyle.yaml @@ -43,4 +43,5 @@ jobs: - name: Run java checkstyle run: + pwd cd flink-doris-redis && mvn clean compile checkstyle:checkstyle \ No newline at end of file From 5a1ba7f87ad21a939e2ba81984ccf1417860306a Mon Sep 17 00:00:00 2001 From: vinlee19 <1401597760@qq.com> Date: Thu, 2 Jan 2025 19:55:03 +0800 Subject: [PATCH 08/14] code format checkstyle test --- .github/workflows/checkstyle.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/checkstyle.yaml b/.github/workflows/checkstyle.yaml index f251d7c..eadfa0c 100644 --- a/.github/workflows/checkstyle.yaml +++ b/.github/workflows/checkstyle.yaml @@ -43,5 +43,4 @@ jobs: - name: Run java checkstyle run: - pwd cd flink-doris-redis && mvn clean compile checkstyle:checkstyle \ No newline at end of file From ba3ce1a9e906b14bf35beb90178f83a0631121de Mon Sep 17 00:00:00 2001 From: vinlee19 <1401597760@qq.com> Date: Thu, 2 Jan 2025 20:02:28 +0800 Subject: [PATCH 09/14] code format checkstyle test --- .github/workflows/checkstyle.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checkstyle.yaml b/.github/workflows/checkstyle.yaml index eadfa0c..c85151f 100644 --- a/.github/workflows/checkstyle.yaml +++ b/.github/workflows/checkstyle.yaml @@ -43,4 +43,5 @@ jobs: - name: Run java checkstyle run: - cd flink-doris-redis && mvn clean compile checkstyle:checkstyle \ No newline at end of file + cd flink-doris-redis + mvn clean compile checkstyle:checkstyle \ No newline at end of file From e3c74889eedb5fc63509adb7cff785b95abd25b1 Mon Sep 17 00:00:00 2001 From: vinlee19 <1401597760@qq.com> Date: Thu, 2 Jan 2025 20:04:03 +0800 Subject: [PATCH 10/14] code format checkstyle test --- .github/workflows/checkstyle.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/checkstyle.yaml b/.github/workflows/checkstyle.yaml index c85151f..706f0d5 100644 --- a/.github/workflows/checkstyle.yaml +++ b/.github/workflows/checkstyle.yaml @@ -43,5 +43,4 @@ jobs: - name: Run java checkstyle run: - cd flink-doris-redis mvn clean compile checkstyle:checkstyle \ No newline at end of file From 0a6e89a4a8ea08560e3e21098eeb690cfbd5034d Mon Sep 17 00:00:00 2001 From: vinlee19 <1401597760@qq.com> Date: Thu, 2 Jan 2025 20:17:03 +0800 Subject: [PATCH 11/14] add more test workflow --- .github/workflows/approve-label-trigger.yml | 28 +++++++++ .github/workflows/approve-label.yml | 67 +++++++++++++++++++++ .github/workflows/build-redis-connector.yml | 44 ++++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 .github/workflows/approve-label-trigger.yml create mode 100644 .github/workflows/approve-label.yml create mode 100644 .github/workflows/build-redis-connector.yml diff --git a/.github/workflows/approve-label-trigger.yml b/.github/workflows/approve-label-trigger.yml new file mode 100644 index 0000000..fab55d7 --- /dev/null +++ b/.github/workflows/approve-label-trigger.yml @@ -0,0 +1,28 @@ +# 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: Label when reviewed +on: pull_request_review +jobs: + + label-when-reviewed: + name: "Label PRs when reviewed" + runs-on: ubuntu-24.04 + steps: + - name: "Do nothing. Only trigger corresponding workflow_run event" + run: echo \ No newline at end of file diff --git a/.github/workflows/approve-label.yml b/.github/workflows/approve-label.yml new file mode 100644 index 0000000..cd82837 --- /dev/null +++ b/.github/workflows/approve-label.yml @@ -0,0 +1,67 @@ +# 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: Label when approved workflow run +on: + workflow_run: + workflows: ["Label when reviewed"] + types: ['requested'] +permissions: + # All other permissions are set to none + checks: write + contents: read + pull-requests: write + +jobs: + + label-when-approved: + name: "Label when approved" + runs-on: ubuntu-24.04 + outputs: + isApprovedByCommiters: ${{ steps.label-when-approved-by-commiters.outputs.isApproved }} + isApprovedByAnyone: ${{ steps.label-when-approved-by-anyone.outputs.isApproved }} + steps: + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" + uses: actions/checkout@v2 + with: + persist-credentials: false + submodules: recursive + - name: "Get information about the original trigger of the run" + uses: ./.github/actions/get-workflow-origin + id: source-run-info + with: + token: ${{ secrets.GITHUB_TOKEN }} + sourceRunId: ${{ github.event.workflow_run.id }} + - name: Label when approved by commiters + uses: ./.github/actions/label-when-approved-action + id: label-when-approved-by-commiters + with: + token: ${{ secrets.GITHUB_TOKEN }} + label: 'approved' + require_committers_approval: 'true' + remove_label_when_approval_missing: 'true' + pullRequestNumber: ${{ steps.source-run-info.outputs.pullRequestNumber }} + comment: 'PR approved by at least one committer and no changes requested.' + - name: Label when approved by anyone + uses: ./.github/actions/label-when-approved-action + id: label-when-approved-by-anyone + with: + token: ${{ secrets.GITHUB_TOKEN }} + label: 'reviewed' + pullRequestNumber: ${{ steps.source-run-info.outputs.pullRequestNumber }} + comment: 'PR approved by anyone and no changes requested.' \ No newline at end of file diff --git a/.github/workflows/build-redis-connector.yml b/.github/workflows/build-redis-connector.yml new file mode 100644 index 0000000..49d62e3 --- /dev/null +++ b/.github/workflows/build-redis-connector.yml @@ -0,0 +1,44 @@ +# 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: Build Connector +on: + pull_request: + push: + +jobs: + build-extension: + name: "Build Connector" + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Setup java + uses: actions/setup-java@v2 + with: + distribution: adopt + java-version: '8' + + - name: Build flink connector 1.15 + run: | + mvn clean package \ + -Dflink.version=1.15.0 \ No newline at end of file From 9dc34e7d08a551a229878fc068b16612059d4d42 Mon Sep 17 00:00:00 2001 From: vinlee19 <1401597760@qq.com> Date: Thu, 2 Jan 2025 20:18:58 +0800 Subject: [PATCH 12/14] skip unit test --- .github/workflows/build-redis-connector.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-redis-connector.yml b/.github/workflows/build-redis-connector.yml index 49d62e3..deeddaa 100644 --- a/.github/workflows/build-redis-connector.yml +++ b/.github/workflows/build-redis-connector.yml @@ -40,5 +40,5 @@ jobs: - name: Build flink connector 1.15 run: | - mvn clean package \ + mvn clean package -DskipTests \ -Dflink.version=1.15.0 \ No newline at end of file From c152bfa6378a2205faab7c0c54540f3f82c19b83 Mon Sep 17 00:00:00 2001 From: vinlee19 <1401597760@qq.com> Date: Thu, 2 Jan 2025 20:21:25 +0800 Subject: [PATCH 13/14] rename workflow name --- .github/workflows/build-redis-connector.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-redis-connector.yml b/.github/workflows/build-redis-connector.yml index deeddaa..c0da65f 100644 --- a/.github/workflows/build-redis-connector.yml +++ b/.github/workflows/build-redis-connector.yml @@ -16,7 +16,7 @@ # under the License. # --- -name: Build Connector +name: Build Redis Connector on: pull_request: push: From 1412fea127af577115fb96ba1086c8974bb52b59 Mon Sep 17 00:00:00 2001 From: vinlee19 <1401597760@qq.com> Date: Thu, 2 Jan 2025 20:38:04 +0800 Subject: [PATCH 14/14] delete approve workflow --- .github/workflows/approve-label-trigger.yml | 28 --------- .github/workflows/approve-label.yml | 67 --------------------- 2 files changed, 95 deletions(-) delete mode 100644 .github/workflows/approve-label-trigger.yml delete mode 100644 .github/workflows/approve-label.yml diff --git a/.github/workflows/approve-label-trigger.yml b/.github/workflows/approve-label-trigger.yml deleted file mode 100644 index fab55d7..0000000 --- a/.github/workflows/approve-label-trigger.yml +++ /dev/null @@ -1,28 +0,0 @@ -# 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: Label when reviewed -on: pull_request_review -jobs: - - label-when-reviewed: - name: "Label PRs when reviewed" - runs-on: ubuntu-24.04 - steps: - - name: "Do nothing. Only trigger corresponding workflow_run event" - run: echo \ No newline at end of file diff --git a/.github/workflows/approve-label.yml b/.github/workflows/approve-label.yml deleted file mode 100644 index cd82837..0000000 --- a/.github/workflows/approve-label.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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: Label when approved workflow run -on: - workflow_run: - workflows: ["Label when reviewed"] - types: ['requested'] -permissions: - # All other permissions are set to none - checks: write - contents: read - pull-requests: write - -jobs: - - label-when-approved: - name: "Label when approved" - runs-on: ubuntu-24.04 - outputs: - isApprovedByCommiters: ${{ steps.label-when-approved-by-commiters.outputs.isApproved }} - isApprovedByAnyone: ${{ steps.label-when-approved-by-anyone.outputs.isApproved }} - steps: - - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" - uses: actions/checkout@v2 - with: - persist-credentials: false - submodules: recursive - - name: "Get information about the original trigger of the run" - uses: ./.github/actions/get-workflow-origin - id: source-run-info - with: - token: ${{ secrets.GITHUB_TOKEN }} - sourceRunId: ${{ github.event.workflow_run.id }} - - name: Label when approved by commiters - uses: ./.github/actions/label-when-approved-action - id: label-when-approved-by-commiters - with: - token: ${{ secrets.GITHUB_TOKEN }} - label: 'approved' - require_committers_approval: 'true' - remove_label_when_approval_missing: 'true' - pullRequestNumber: ${{ steps.source-run-info.outputs.pullRequestNumber }} - comment: 'PR approved by at least one committer and no changes requested.' - - name: Label when approved by anyone - uses: ./.github/actions/label-when-approved-action - id: label-when-approved-by-anyone - with: - token: ${{ secrets.GITHUB_TOKEN }} - label: 'reviewed' - pullRequestNumber: ${{ steps.source-run-info.outputs.pullRequestNumber }} - comment: 'PR approved by anyone and no changes requested.' \ No newline at end of file