-
Notifications
You must be signed in to change notification settings - Fork 46
70 lines (64 loc) · 2.01 KB
/
OnPRRecheck.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: PRReCheck
run-name: "PR ${{ github.event.number }} Recheck"
on:
pull_request_target:
types: [ labeled ]
concurrency:
group: check-${{ github.event.number }}
cancel-in-progress: true
env:
PR_NUMBER: ${{ github.event.number }}
jobs:
Setup:
if: ${{ github.event.label.name == vars.RECHECKPR_LABEL }}
runs-on: ubuntu-latest
steps:
- name: Set Label
id: setlabel
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit --repo ${{ github.repository }} \
--remove-label ${{ vars.RECHECKPR_LABEL }} \
--remove-label ${{ vars.PR_SUBMIT_TESTS_PASSED }} \
--remove-label ${{ vars.PR_SUBMIT_TESTS_FAILED }} \
--add-label ${{ vars.PR_SUBMIT_TESTING_IN_PROGRESS }} \
$PR_NUMBER || :
Check:
name: Check
needs: Setup
uses: asterisk/asterisk-ci-actions/.github/workflows/RunTestsuiteUnitTest.yml@main
with:
pr_number: ${{ github.event.number }}
base_branch: ${{ github.event.pull_request.base.ref }}
unittest_command: ${{ vars.UNITTEST_COMMAND }}
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Summary:
if: ${{ success() || failure() }}
runs-on: ubuntu-latest
needs: [Setup,Check]
steps:
- name: Check status
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RESULT_UNIT: ${{ needs.Check.result }}
TESTS_PASSED: ${{ vars.PR_SUBMIT_TESTS_PASSED }}
TESTS_FAILED: ${{ vars.PR_SUBMIT_TESTS_FAILED }}
run: |
declare -i rc=0
case $RESULT_UNIT in
success)
;;
skipped)
rc+=1
;;
*)
rc+=1
esac
[ $rc -gt 0 ] && label=$TESTS_FAILED || label=$TESTS_PASSED
gh pr edit --repo ${{ github.repository }} \
--remove-label ${{ vars.PR_SUBMIT_TESTING_IN_PROGRESS }} \
--add-label $label \
$PR_NUMBER || :
exit $rc