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