File tree Expand file tree Collapse file tree 2 files changed +37
-17
lines changed Expand file tree Collapse file tree 2 files changed +37
-17
lines changed Original file line number Diff line number Diff line change 56
56
event_action=$(cat ./event_action)
57
57
echo "pr_number=${pr_number}" >> $GITHUB_OUTPUT
58
58
echo "event_action=${event_action}" >> $GITHUB_OUTPUT
59
-
60
- add_ci_passed_label :
61
- name : Add 'ci-passed' label
62
- runs-on : ubuntu-latest
63
- needs : fetch_data
64
- steps :
65
- - name : Add 'ci-passed' label
66
- run : |
67
- echo "Adding 'ci-passed' label to PR #${{ needs.fetch_data.outputs.pr_number }}"
68
- gh pr edit ${{ needs.fetch_data.outputs.pr_number }} --add-label "ci-passed" --repo $GITHUB_REPOSITORY
69
- env :
70
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
71
-
59
+
72
60
reset_ci_passed_label :
73
61
name : Reset 'ci-passed' label on PR Synchronization
74
62
runs-on : ubuntu-latest
82
70
fi
83
71
env :
84
72
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
73
+
74
+ add_ci_passed_label :
75
+ name : Add 'ci-passed' label
76
+ runs-on : ubuntu-latest
77
+ needs : fetch_data
78
+ steps :
79
+ - name : Add 'ci-passed' label
80
+ run : |
81
+ echo "Adding 'ci-passed' label to PR #${{ needs.fetch_data.outputs.pr_number }}"
82
+ gh pr edit ${{ needs.fetch_data.outputs.pr_number }} --add-label "ci-passed" --repo $GITHUB_REPOSITORY
83
+ env :
84
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1
- # This workflow checks if all CI checks have passed by polling every 5 minutes for a total of 7 attempts.
1
+ # This workflow checks if all CI checks have passed by polling every 5 minutes for a total of 8 attempts.
2
2
name : CI Check
3
3
4
4
on :
5
5
pull_request :
6
- types : [opened, synchronize, reopened]
6
+ types : [opened, synchronize, reopened, labeled ]
7
7
8
8
jobs :
9
9
check_ci_status :
10
10
runs-on : ubuntu-latest
11
11
permissions :
12
12
checks : read
13
13
pull-requests : write
14
- steps :
14
+ steps :
15
+ - name : Check out the repository
16
+ uses : actions/checkout@v3
17
+
18
+ - name : Check for 'needs-ok-to-test' and 'ok-to-test' labels
19
+ id : label_check
20
+ run : |
21
+ LABELS=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
22
+ if echo "$LABELS" | grep -q 'needs-ok-to-test'; then
23
+ echo "Label 'needs-ok-to-test' found. Skipping the workflow."
24
+ exit 0
25
+ fi
26
+ if echo "$LABELS" | grep -q 'ok-to-test'; then
27
+ echo "Label 'ok-to-test' found. Continuing the workflow."
28
+ else
29
+ echo "Label 'ok-to-test' not found. Skipping the workflow."
30
+ exit 0
31
+ fi
32
+ env :
33
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34
+
15
35
- name : Check if all CI checks passed
16
36
uses : wechuli/allcheckspassed@0b68b3b7d92e595bcbdea0c860d05605720cf479
17
37
with :
18
38
delay : ' 5'
19
- retries : ' 7 '
39
+ retries : ' 8 '
20
40
polling_interval : ' 5'
21
41
env :
22
42
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments