File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : GitHub Advisory Check
2+
3+ on :
4+ schedule :
5+ - cron : ' 15 * * * *' # Every hour at :15
6+ workflow_dispatch : # Allow manual triggering
7+
8+ permissions :
9+ security-events : read
10+
11+ jobs :
12+ check :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Check GitHub security advisories
16+ env :
17+ GH_TOKEN : ${{ github.token }}
18+ shell : bash
19+ run : |
20+ # Fetch advisories in triage state using GitHub REST API
21+ advisories=$(curl -s -L \
22+ -H "Accept: application/vnd.github+json" \
23+ -H "Authorization: Bearer $GH_TOKEN" \
24+ -H "X-GitHub-Api-Version: 2022-11-28" \
25+ "https://api.github.com/repos/${{ github.repository }}/security-advisories?state=triage")
26+
27+ # Build the sync payload
28+ payload=$(echo "$advisories" | jq '{
29+ advisories: [.[] | {
30+ ghsaId: .ghsa_id,
31+ summary: .summary,
32+ reportedAt: .created_at
33+ }]
34+ }')
35+
36+ count=$(echo "$payload" | jq '.advisories | length')
37+ echo "Found $count advisories in triage"
38+
39+ # Post to EPPlus API
40+ response=$(curl -s -o response.json -w "%{http_code}" \
41+ -X POST "https://epplussoftware.com/api/security/github-advisories/sync" \
42+ -H "X-Api-Key: ${{ secrets.EPPLUS_VULNERABILITY_API_KEY }}" \
43+ -H "Content-Type: application/json" \
44+ -d "$payload")
45+
46+ if [ "$response" != "200" ]; then
47+ echo "::warning::Advisory sync failed with HTTP $response"
48+ cat response.json
49+ else
50+ echo "Advisory sync successful:"
51+ cat response.json
52+ fi
You can’t perform that action at this time.
0 commit comments