Skip to content

PR 75 Recheck

PR 75 Recheck #8

Workflow file for this run

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