Skip to content

Commit 90089d7

Browse files
authored
Refactor GitHub advisory check workflow
Updated the GitHub advisory check workflow to use a secret token for authentication and modified the API request to filter advisories by triage state.
1 parent c8fb9ef commit 90089d7

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

.github/workflows/github-advisory-check.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,21 @@ on:
55
- cron: '15 * * * *' # Every hour at :15
66
workflow_dispatch: # Allow manual triggering
77

8-
permissions:
9-
security-events: read
10-
118
jobs:
129
check:
1310
runs-on: ubuntu-latest
1411
steps:
1512
- name: Check GitHub security advisories
1613
env:
17-
GH_TOKEN: ${{ github.token }}
14+
GH_TOKEN: ${{ secrets.ADVISORY_READ_TOKEN }}
1815
shell: bash
1916
run: |
20-
# Fetch all advisories (no state filter) for debugging
17+
# Fetch advisories in triage state using GitHub REST API
2118
advisories=$(curl -s -L \
2219
-H "Accept: application/vnd.github+json" \
2320
-H "Authorization: Bearer $GH_TOKEN" \
2421
-H "X-GitHub-Api-Version: 2022-11-28" \
25-
"https://api.github.com/repos/${{ github.repository }}/security-advisories")
26-
27-
# Debug: print raw API response
28-
echo "Raw API response:"
29-
echo "$advisories"
22+
"https://api.github.com/repos/${{ github.repository }}/security-advisories?state=triage")
3023
3124
# Build the sync payload
3225
payload=$(echo "$advisories" | jq '{

0 commit comments

Comments
 (0)