Keycloak
27 строк · 687.0 Байт
1name: Check required jobs
2description: Check if all required jobs where successful or skipped
3
4inputs:
5jobs:
6description: Jobs (value must be toJSON(needs))
7required: true
8
9runs:
10using: "composite"
11steps:
12- id: check-jobs
13name: Check jobs
14shell: bash
15run: |
16JOBS='${{ inputs.jobs }}'
17
18echo "Job status:"
19echo $JOBS | jq -r 'to_entries[] | " - \(.key): \(.value.result)"'
20
21for i in $(echo $JOBS | jq -r 'to_entries[] | .value.result'); do
22if [ "$i" != "success" ] && [ "$i" != "skipped" ]; then
23echo ""
24echo "Status check not okay!"
25exit 1
26fi
27done
28