|
|
@@ -14,7 +14,7 @@ ghsa_json=$(gh api \
|
|
|
/repos/$github_org/$github_repo/security-advisories?per_page=100 --paginate )
|
|
|
|
|
|
# Get a list of GHSAs that don't have the $team_to_add_slug in collaborating_teams
|
|
|
-ghsa_without_team=$( jq -r '[ .[] | select(all(.collaborating_teams.[]; .slug != "'"$team_to_add_slug"'")) | .ghsa_id ] | sort | .[] ' <<< "$ghsa_json" )
|
|
|
+ghsa_without_team=$( jq -r '[ .[] | select(.state != "closed" and all(.collaborating_teams.[]; .slug != "'"$team_to_add_slug"'")) | .ghsa_id ] | sort | .[] ' <<< "$ghsa_json" )
|
|
|
if [[ -z $ghsa_without_team ]]; then
|
|
|
echo "All GHSAs already have $team_to_add_slug. Exiting..."
|
|
|
exit 0
|