diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index 0204fb41ae93..033c4b224c1e 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -3,7 +3,7 @@ name: CI Check on: pull_request: - types: [opened, synchronize, reopened] + types: [opened, synchronize, reopened, labeled] jobs: check_ci_status: @@ -14,16 +14,20 @@ jobs: steps: - name: Check out the repository uses: actions/checkout@v3 - - - name: Check for 'needs-ok-to-test' label + + - name: Check for 'needs-ok-to-test' and 'ok-to-test' labels id: label_check - run: | - LABELS=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name') + run: | + LABELS=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name') if echo "$LABELS" | grep -q 'needs-ok-to-test'; then echo "Label 'needs-ok-to-test' found. Skipping the workflow." exit 0 + fi + if echo "$LABELS" | grep -q 'ok-to-test'; then + echo "Label 'ok-to-test' found. Continuing the workflow." else - echo "Label 'needs-ok-to-test' not found. Continuing the workflow." + echo "Label 'ok-to-test' not found. Skipping the workflow." + exit 0 fi env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}