Skip to content

Commit

Permalink
Updated ci-check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
VaniHaripriya committed Oct 15, 2024
1 parent bc471e8 commit d1fdd6d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI Check

on:
pull_request:
types: [opened, synchronize, reopened]
types: [opened, synchronize, reopened, labeled]

jobs:
check_ci_status:
Expand All @@ -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 }}
Expand Down

0 comments on commit d1fdd6d

Please sign in to comment.