diff --git a/.github/workflows/enforce-labels.yml b/.github/workflows/enforce-labels.yml index 65f63666..86b5f910 100644 --- a/.github/workflows/enforce-labels.yml +++ b/.github/workflows/enforce-labels.yml @@ -5,15 +5,20 @@ on: workflow_call: pull_request: types: [labeled, unlabeled, opened, reopened, synchronize] + jobs: enforce-label: - if: ${{ contains(github.event.*.labels.*.name, 'hold') || contains(github.event.*.labels.*.name, 'needs-qa') }} name: Enforce label runs-on: ubuntu-22.04 steps: - name: Check for label + env: + LABEL_HOLD: ${{ contains(github.event.*.labels.*.name, 'hold') }} + LABEL_NEEDS_QA: ${{ contains(github.event.*.labels.*.name, 'needs-qa') }} run: | - echo "PRs with the hold or needs-qa labels cannot be merged" - echo "### :x: PRs with the hold or needs-qa labels cannot be merged" >> $GITHUB_STEP_SUMMARY - exit 1 + if [[ "$LABEL_HOLD" = "true" ]] || [[ "$LABEL_NEEDS_QA" = "true" ]]; then + echo "PRs with the hold or needs-qa labels cannot be merged" + echo "### :x: PRs with the hold or needs-qa labels cannot be merged" >> $GITHUB_STEP_SUMMARY + exit 1 + fi