Skip to content

Commit 92fb00c

Browse files
committed
Update workflows-notify.yaml
1 parent 7a2918a commit 92fb00c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

.github/workflows/workflows-notify.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,21 @@ jobs:
2727
OneClickInstall-Docs|ci-docs-test.yml|OneClickDocs-Install
2828
OneClickInstall-Docs|ci-update.yml|OneClickDocs-Update
2929
OneClickInstall-Docs|scripts-upload-s3.yml|Upload on S3
30-
3130
run: |
3231
declare -A REPO_STATUS
3332
while IFS='|' read -r REPO WORKFLOW WORKFLOW_NAME; do
3433
[[ -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")"
3636
[[ ! $(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)
3838
| select(.head_branch | test("^(master|release/.+|hotfix/.+|develop)$"))]')
3939
FAIL_COUNT=$(echo "$RUNS" | jq '[.[] | select((.conclusion? // "failure") | test("failure|failed|error|startup_failure"))] | length')
4040
STATUS=$([[ $(echo "$RUNS" | jq 'length') -eq 0 ]] && echo "\u26AA" || ([[ $FAIL_COUNT -gt 0 ]] && echo "\uD83D\uDD34" || echo "\uD83D\uDFE2"))
4141
REPO_STATUS["$REPO"]+="$STATUS [$WORKFLOW_NAME](https://github.com/ONLYOFFICE/$REPO/actions/workflows/$WORKFLOW)\n"
4242
done <<< "$WORKFLOWS"
4343
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)
4745
4846
[[ -n "$RESULT" ]] && curl -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
4947
-H "Content-Type: application/json" \

0 commit comments

Comments
 (0)