File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -34,15 +34,14 @@ jobs:
34
34
while IFS='|' read -r REPO WORKFLOW WORKFLOW_NAME; do
35
35
[[ -z "$REPO" || -z "$WORKFLOW" ]] && continue
36
36
FULL_REPO="ONLYOFFICE/$REPO"
37
- API_URL="https://api.github.com/repos/$FULL_REPO/actions/workflows/$WORKFLOW/runs?per_page=100"
38
- RUNS_RESPONSE="$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "$API_URL")"
39
37
40
- [[ ! $(echo "$RUNS_RESPONSE" | jq -e .workflow_runs) ]] && continue
38
+ RUNS=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
39
+ "https://api.github.com/repos/$FULL_REPO/actions/workflows/$WORKFLOW/runs?per_page=100" |
40
+ jq --arg start "$(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ)" '[.workflow_runs[]
41
+ | select(.created_at >= $start and .head_branch | test("^(master|release/.+|hotfix/.+|develop)$"))]')
41
42
42
- RUNS=$(echo "$RUNS_RESPONSE" | jq --arg start "$(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ)" '[.workflow_runs[]
43
- | select(.created_at >= $start)
44
- | select(.head_branch | test("^(master|release/.+|hotfix/.+|develop)$"))]')
45
- FAIL_COUNT=$(echo "$RUNS" | jq '[.[] | select((.conclusion? // "failure") | test("failure|failed|error|startup_failure"))] | length')
43
+ COUNT=$(echo "$RUNS" | jq 'length')
44
+ FAIL=$(echo "$RUNS" | jq '[.[] | select((.conclusion? // "failure") | test("failure|failed|error|startup_failure"))] | length')
46
45
STATUS=$([[ $(echo "$RUNS" | jq 'length') -eq 0 ]] && echo "\u26AA" || ([[ $FAIL_COUNT -gt 0 ]] && echo "\uD83D\uDD34" || echo "\uD83D\uDFE2"))
47
46
REPO_STATUS["$REPO"]+="$STATUS [$WORKFLOW_NAME](https://github.com/$FULL_REPO/actions/workflows/$WORKFLOW)\n"
48
47
done <<< "$WORKFLOWS"
You can’t perform that action at this time.
0 commit comments