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

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new d2ec455b6 ci: Skip style-check workflow if label is present
d2ec455b6 is described below

commit d2ec455b6d39089386ae5cf9debd37b88b9de994
Author: Szymon Czapracki <[email protected]>
AuthorDate: Fri Jun 27 17:14:23 2025 +0200

    ci: Skip style-check workflow if label is present
    
    This update adds a label-based conditional to the compliance_check.yml
    GitHub Actions workflow. If a pull request includes the label
    `skip-style-check`, the style check step will be skipped.
    
    This allows maintainers to bypass formatting validation in exceptional
    cases, such as bulk updates or style-irrelevant changes.
---
 .github/workflows/compliance_check.yml | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/compliance_check.yml 
b/.github/workflows/compliance_check.yml
index 7da84f929..9ad768a40 100644
--- a/.github/workflows/compliance_check.yml
+++ b/.github/workflows/compliance_check.yml
@@ -19,7 +19,9 @@
 
 name: Compliance check
 
-on: [pull_request]
+on:
+  pull_request:
+    types: [opened, synchronize, reopened, labeled, unlabeled]
 
 jobs:
   style_check:
@@ -33,7 +35,23 @@ jobs:
         shell: bash
         run: |
              python -m pip install clang-format
+
+      - name: Check label
+        id: label_check
+        uses: actions/github-script@v7
+        with:
+          script: |
+            const labelName = 'skip-style-check';
+            const labels = await github.rest.issues.listLabelsOnIssue({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              issue_number: context.payload.pull_request.number,
+            });
+            const hasLabel = labels.data.some(label => label.name === 
labelName);
+            core.setOutput('skip', hasLabel);
+
       - name: check style
+        if: steps.label_check.outputs.skip != 'true'
         shell: bash
         run: |
           set +e

Reply via email to