This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch ci_no_hold
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 7893226587019d0471eee5e01d61a2848fa2e637
Author: Maxime Beauchemin <[email protected]>
AuthorDate: Mon Jan 29 17:01:11 2024 -0800

    feat(ci): add a check to make sure there's no hold label on the PR
    
    noticed on another PR (https://github.com/apache/superset/pull/26836)
    that we use `hold.*` labels, but they don't really hold the merge. After
    almost merging and realizing the hold after, I got GPT to generate the
    action here and tested it on that PR.
---
 .github/workflows/no-hold-label.yml | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/.github/workflows/no-hold-label.yml 
b/.github/workflows/no-hold-label.yml
new file mode 100644
index 0000000000..1622637ee4
--- /dev/null
+++ b/.github/workflows/no-hold-label.yml
@@ -0,0 +1,20 @@
+name: Hold Label Check
+
+on:
+  pull_request:
+    types: [labeled, unlabeled, opened, reopened, synchronize]
+
+jobs:
+  check-hold-label:
+    runs-on: ubuntu-latest
+    steps:
+    - name: Check for 'hold' label
+      uses: actions/github-script@v3
+      with:
+        github-token: ${{secrets.GITHUB_TOKEN}}
+        script: |
+          const payload = context.payload.pull_request
+          const label = !!payload.labels.find(label => 
label.name.includes('hold'))
+          if (label) {
+            core.setFailed('Hold label is present, merge is blocked.')
+          }

Reply via email to