Created
June 3, 2021 11:34
-
-
Save pwfcurry/29574490e5737026bb74cf216907077e to your computer and use it in GitHub Desktop.
List all semaphore workflows for a project
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 | |
# Replace <API_TOKEN> with your token from https://me.semaphoreci.com/account | |
# Replace <PROJECT_ID> with the project ID (can get this by describing a job: https://docs.semaphoreci.com/reference/api-v1alpha/#describe-job) | |
# Run the following to get the page count (in the `link` header, rel=last) & replace 69 below with the value: | |
# | |
# curl -sIXGET -H "Authorization: Token <API_TOKEN>" \ | |
# "https://countingup.semaphoreci.com/api/v1alpha/plumber-workflows?project_id=<PROJECT_ID>" | |
# | |
# See https://docs.semaphoreci.com/reference/api-v1alpha/#pagination | |
for i in {1..69} | |
do | |
file=sem_workflows_page_$i.json | |
echo $file | |
curl -s -H "Authorization: Token <API_TOKEN>" \ | |
"https://countingup.semaphoreci.com/api/v1alpha/plumber-workflows?page=$i&project_id=<PROJECT_ID>" > $file & | |
done | |
wait | |
echo "done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Process output with https://gist.github.com/pwfcurry/e84fc777e3abbdbec8f4a0e8bd0e8d87