@@ -37,22 +37,17 @@ jobs:
37
37
FULL_REPO="ONLYOFFICE/$REPO"
38
38
REPO_LIST["$REPO"]=1
39
39
WORKFLOW_URL="https://github.com/$FULL_REPO/actions/workflows/$WORKFLOW"
40
- RUNS_API_URL="https://api.github.com/repos/$FULL_REPO/actions/workflows/$WORKFLOW/runs?per_page=50 "
40
+ RUNS_API_URL="https://api.github.com/repos/$FULL_REPO/actions/workflows/$WORKFLOW/runs?per_page=100 "
41
41
RUNS_RESPONSE="$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "$RUNS_API_URL")"
42
42
43
43
[[ ! $(echo "$RUNS_RESPONSE" | jq -e .workflow_runs) ]] && continue
44
44
45
- RUNS=$(echo "$RUNS_RESPONSE" | jq --arg start "$(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ)" \
46
- '[.workflow_runs[]
47
- | select(.created_at >= $start)
48
- | select(.head_branch | test("^(master|release/.+|hotfix/.+|develop)$"))]')
49
-
45
+ RUNS=$(echo "$RUNS_RESPONSE" | jq --arg start "$(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ)" '[.workflow_runs[]
46
+ | select(.created_at >= $start)
47
+ | select(.head_branch | test("^(master|release/.+|hotfix/.+|develop)$"))]')
50
48
TOTAL_COUNT=$(echo "$RUNS" | jq 'length')
51
49
FAIL_COUNT=$(echo "$RUNS" | jq '[.[] | select((.conclusion? // "failure") | test("failure|failed|error|startup_failure"))] | length')
52
-
53
- STATUS="\u26AA"
54
- (( TOTAL_COUNT > 0 )) && STATUS=$([[ $FAIL_COUNT -gt 0 ]] && echo "\uD83D\uDD34" || echo "\uD83D\uDFE2")
55
-
50
+ STATUS=$([[ $TOTAL_COUNT -eq 0 ]] && echo "\u26AA" || ([[ $FAIL_COUNT -gt 0 ]] && echo "\uD83D\uDD34" || echo "\uD83D\uDFE2"))
56
51
REPO_STATUS["$REPO"]+="$STATUS [$WORKFLOW_NAME]($WORKFLOW_URL)\n"
57
52
done <<< "$WORKFLOWS"
58
53
64
59
-H "Content-Type: application/json" \
65
60
-d "{\"chat_id\": \"${TELEGRAM_CHAT_ID}\", \"text\": \"$RESULT\", \"parse_mode\": \"Markdown\", \"disable_web_page_preview\": true}"
66
61
62
+ # [[ -n "$RESULT" ]] && curl -s "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/getUpdates" | jq -r '.result[].message.chat.id' | sort -u | \
63
+ # xargs -I {} curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" -H "Content-Type: application/json" \
64
+ # -d "{\"chat_id\": \"{}\", \"text\": \"$RESULT\", \"parse_mode\": \"Markdown\", \"disable_web_page_preview\": true}"
65
+
0 commit comments