File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,20 +23,11 @@ jobs:
2323 echo "Checking for alerts created after: $TIME_THRESHOLD"
2424
2525 # 2. Fetch alerts using GitHub CLI
26- # FIX: Added [ ] wrapping to force output as an Array [{...}]
2726 ALERTS=$(gh api "/repos/${{ github.repository }}/dependabot/alerts" \
2827 --jq "[ .[] | select(.state == \"open\") | select(.created_at > \"$TIME_THRESHOLD\") | select(.security_advisory.severity == \"critical\" or .security_advisory.severity == \"high\") ]")
2928
3029 # 3. Check if any alerts were found
31- # Now valid because ALERTS is definitely an array
32- LENGTH=$(echo "$ALERTS" | jq 'length')
3330
34- if [ "$LENGTH" -eq 0 ]; then
35- echo "No new alerts found in the last hour."
36- exit 0
37- fi
38-
39- echo "New alerts detected! Sending notification..."
4031
4132 # 4. Extract details from the first alert found
4233 # Now valid because ALERTS is an array, so .[0] exists
You can’t perform that action at this time.
0 commit comments