Skip to content

Commit

Permalink
Add early exit to add-team-to-ghsa (#2829)
Browse files Browse the repository at this point in the history
Add early exit to workflow if there are no teams that don't already have the team
  • Loading branch information
willhickey authored Sep 4, 2024
1 parent 7e8a1dd commit 7c9bbc4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/scripts/add-team-to-ghsa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ ghsa_json=$(gh api \

# 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" )
if [[ -z $ghsa_without_team ]]; then
echo "All GHSAs already have $team_to_add_slug. Exiting..."
exit 0
fi

# Iterate through the teams
while IFS= read -r ghsa_id; do
Expand Down

0 comments on commit 7c9bbc4

Please sign in to comment.