mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-09 21:22:26 +03:00
13 lines
466 B
Bash
Executable File
13 lines
466 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# ciwatch [INTERVALSECS] - watch the latest Github actions run until it completes, returning the exit status
|
|
|
|
INTERVAL="${1:-10}"
|
|
|
|
LATESTRUNNING=$(gh run list --json status,databaseId -q '.[] | select(.status | in({"in_progress":0,"queued":0,"requested":0,"waiting":0})).databaseId' | head -1)
|
|
|
|
if [[ -n $LATESTRUNNING ]]; then
|
|
gh run watch -i"$INTERVAL" "$LATESTRUNNING" --exit-status
|
|
else
|
|
echo "no runs in progress, attempting push"
|
|
fi
|