Skip to content

Commit

Permalink
Update ci-check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
VaniHaripriya committed Oct 14, 2024
1 parent 811cc2b commit 25c6ebf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/add-ci-passed-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,7 @@ jobs:
event_action=$(cat ./event_action)
echo "pr_number=${pr_number}" >> $GITHUB_OUTPUT
echo "event_action=${event_action}" >> $GITHUB_OUTPUT
add_ci_passed_label:
name: Add 'ci-passed' label
runs-on: ubuntu-latest
needs: fetch_data
steps:
- name: Add 'ci-passed' label
run: |
echo "Adding 'ci-passed' label to PR #${{ needs.fetch_data.outputs.pr_number }}"
gh pr edit ${{ needs.fetch_data.outputs.pr_number }} --add-label "ci-passed" --repo $GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

reset_ci_passed_label:
name: Reset 'ci-passed' label on PR Synchronization
runs-on: ubuntu-latest
Expand All @@ -82,3 +70,15 @@ jobs:
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

add_ci_passed_label:
name: Add 'ci-passed' label
runs-on: ubuntu-latest
needs: fetch_data
steps:
- name: Add 'ci-passed' label
run: |
echo "Adding 'ci-passed' label to PR #${{ needs.fetch_data.outputs.pr_number }}"
gh pr edit ${{ needs.fetch_data.outputs.pr_number }} --add-label "ci-passed" --repo $GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 15 additions & 2 deletions .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow checks if all CI checks have passed by polling every 5 minutes for a total of 7 attempts.
# This workflow checks if all CI checks have passed by polling every 5 minutes for a total of 8 attempts.
name: CI Check

on:
Expand All @@ -11,7 +11,20 @@ jobs:
permissions:
checks: read
pull-requests: write
steps:
steps:
- name: Check for 'needs-ok-to-test' label
id: label_check
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
else
echo "Label 'needs-ok-to-test' not found. Continuing the workflow."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check if all CI checks passed
uses: wechuli/allcheckspassed@0b68b3b7d92e595bcbdea0c860d05605720cf479
with:
Expand Down

0 comments on commit 25c6ebf

Please sign in to comment.