Name | Path | Schedule(UTC) |
---|---|---|
foo | .github/workflows/test-foo.yaml | 0 18 * * 1-5 |
bar | .github/workflows/test-bar.yaml | 0 0 * * * 0 18 * * * |
Last active
August 30, 2024 13:38
-
-
Save guitarrapc/a49427e1bb57fb77584a38b5b3a93e6d to your computer and use it in GitHub Desktop.
List GitHub Actions workflow which has on.schedule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
set -euo pipefaiil | |
echo "| Name | Path | Schedule (UTC) |" | |
echo "| ---- | ---- | ---- |" | |
json=$(gh workflow list --json name,path,state --limit 300) | |
echo "$json" | jq -c '.[] | select(.state == "active") | {name: .name, path: .path}' | sort | while read -r item; do | |
name=$(echo "$item" | jq -r '.name') | |
path=$(echo "$item" | jq -r '.path') | |
if [[ ! -f "$path" ]]; then continue; fi | |
schedule=$(cat "$path" | yq -o=json | jq -r 'select(.on.schedule != null) | [.on.schedule[].cron] | join("<br/>")') | |
if [[ -z "$schedule" ]]; then continue; fi | |
echo "| $name | $path | $schedule |" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: bar | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
- cron: "0 18 * * *" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: foo | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 18 * * 1-5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: val | |
on: | |
workflow_dispatch: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment