Skip to content
Snippets Groups Projects
Commit d43d38cd authored by Tiago Lucas's avatar Tiago Lucas
Browse files

Simplifying output on the list-ghsa.sh script

parent c4e786ea
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,13 @@
set -euo pipefail
IFS=$'\n\t'
(command -v gh >/dev/null 2>&1 && command -v jsonnet >/dev/null 2>&1) || {
echo >&2 "This script requires the GitHub CLI tool (gh), the command-line JSON processor (jq) and the Jsonnet CLI, but one of them is not installed."
echo >&2 "Please download and install both tools."
echo >&2 "Aborting."
exit 1
}
{
for org in $(gh api --cache 3h --paginate /user/orgs | jq -r '.[].login'); do
if gh api --cache 3h --paginate "/orgs/${org}/security-advisories" >/dev/null 2>&1; then
......@@ -25,4 +32,4 @@ IFS=$'\n\t'
fi
done
echo '[]'
} | jsonnet - | jq
\ No newline at end of file
} | jsonnet - | jq 'sort_by(.updated_at) | map({updated_at, summary, html_url, state: .credits_detailed[0].state})'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment