Created
April 17, 2022 19:27
-
-
Save jettero/cc6610ce6549d2c03222ad14c99a4fa1 to your computer and use it in GitHub Desktop.
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 | |
# simple jq task: reduce list of objects with by workflow_id and job id | |
# into a object { workflow_id => [list of job ids] } | |
# | |
# .o(this seriously took like 2 whole hours ot figure out) | |
gh api repos/$owner_slash_repo/actions/runs?per_page=100 \ | |
| jq '[ .workflow_runs | group_by(.workflow_id)[] | {(.[0].workflow_id|tostring): [ .[] | .id ]} ] | |
| reduce .[] as $item ({}; . * $item)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment