Using the Stage Results API in custom scripts
You can use the Stage Results API to access the results of specific stages and custom stages.
- Type
get_data result
to print which stages have saved results:
$ get_data result
test
detect-secrets
branch-protection
- Type
get_data result <stage-name>
to print the result for a specific stage:
$ get_data result detect-secrets
success
$ get_data result test
failure
- Iterate through the saved results:
#!/usr/bin/env bash
while read -r stage; do
result=$(get_data result $stage)
echo "The result of '$stage' stage is: '$result'"
done < <(get_data result)
Outputs the following lines to the console:
The result of 'detect-secrets' stage is: 'success'
The result of 'branch-protection' stage is: 'success'