@@ -27,23 +27,21 @@ jobs:
27
27
OneClickInstall-Docs|ci-docs-test.yml|OneClickDocs-Install
28
28
OneClickInstall-Docs|ci-update.yml|OneClickDocs-Update
29
29
OneClickInstall-Docs|scripts-upload-s3.yml|Upload on S3
30
-
31
30
run : |
32
31
declare -A REPO_STATUS
33
32
while IFS='|' read -r REPO WORKFLOW WORKFLOW_NAME; do
34
33
[[ -z "$REPO" || -z "$WORKFLOW" ]] && continue
35
- RUNS_RESPONSE="$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/ONLYOFFICE/$REPO/actions/workflows/$WORKFLOW/runs?per_page=100")"
34
+ RUNS_RESPONSE="$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
35
+ "https://api.github.com/repos/ONLYOFFICE/$REPO/actions/workflows/$WORKFLOW/runs?per_page=100")"
36
36
[[ ! $(echo "$RUNS_RESPONSE" | jq -e .workflow_runs) ]] && continue
37
- RUNS=$(echo "$RUNS_RESPONSE" | jq --arg start "$(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ)" '[.workflow_runs[]| select(.created_at >= $start)
37
+ RUNS=$(echo "$RUNS_RESPONSE" | jq --arg start "$(date -u -d '48 hours ago' +%Y-%m-%dT%H:%M:%SZ)" '[.workflow_runs[]| select(.created_at >= $start)
38
38
| select(.head_branch | test("^(master|release/.+|hotfix/.+|develop)$"))]')
39
39
FAIL_COUNT=$(echo "$RUNS" | jq '[.[] | select((.conclusion? // "failure") | test("failure|failed|error|startup_failure"))] | length')
40
40
STATUS=$([[ $(echo "$RUNS" | jq 'length') -eq 0 ]] && echo "\u26AA" || ([[ $FAIL_COUNT -gt 0 ]] && echo "\uD83D\uDD34" || echo "\uD83D\uDFE2"))
41
41
REPO_STATUS["$REPO"]+="$STATUS [$WORKFLOW_NAME](https://github.com/ONLYOFFICE/$REPO/actions/workflows/$WORKFLOW)\n"
42
42
done <<< "$WORKFLOWS"
43
43
44
- for REPO in "${!REPO_STATUS[@]}"; do
45
- RESULT+="*$REPO*\n${REPO_STATUS[$REPO]}\n"
46
- done
44
+ RESULT+=$(for REPO in "${!REPO_STATUS[@]}"; do echo -e "*$REPO*\n${REPO_STATUS[$REPO]}"; done)
47
45
48
46
[[ -n "$RESULT" ]] && curl -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
49
47
-H "Content-Type: application/json" \
0 commit comments