Skip to content

Commit 27ec306

Browse files
Update Security-Notification.yml
Add more messaging to debug
1 parent 5c02b07 commit 27ec306

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/Security-Notification.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Security Vulnerability Slack Notification
2-
32
on:
43
schedule:
54
- cron: '0 * * * *' # Runs every hour
@@ -14,7 +13,8 @@ jobs:
1413

1514
- name: Check for Recent Alerts
1615
env:
17-
16+
# Use a PAT instead of the default token
17+
GH_TOKEN: ${{ secrets.DEPENDABOT_PAT }}
1818
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
1919
run: |
2020
# 1. Calculate time 65 minutes ago
@@ -24,9 +24,10 @@ jobs:
2424
2525
# 2. Fetch alerts using GitHub CLI
2626
# Note: We point to the API endpoint explicitly
27-
ALERTS=$(gh api "https://github.com/mongodb/docs-sample-apps/security/dependabot" \
27+
ALERTS=$(gh api "/repos/${{ github.repository }}/dependabot/alerts" \
2828
--jq ".[] | select(.state == \"open\") | select(.created_at > \"$TIME_THRESHOLD\") | select(.security_advisory.severity == \"critical\" or .security_advisory.severity == \"high\")")
29-
29+
30+
echo "Past Alerts step."
3031
# 3. Check if any alerts were found
3132
if [ -z "$ALERTS" ]; then
3233
echo "No new alerts found in the last hour."

0 commit comments

Comments
 (0)