Browse Source

ci: skip closed GHSAs when processing teams (#5015)

ci: skip closed ghsas when processing teams
Yihau Chen 9 months ago
parent
commit
faf2323f0f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      .github/scripts/add-team-to-ghsa.sh

+ 1 - 1
.github/scripts/add-team-to-ghsa.sh

@@ -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