Commit 014e268bda

014e268bda743fe295b408cad0458953bb86f54c

parent: 0d22adce5c

Unsigned

Alicia Sykes <alicia@omg.lol> · 2026-10-10 17:10 UTC

Fixes the check for unpatched security advisories

Layout: unified · split

.github/CONTRIBUTING.md +1 −1
@@ -303,7 +303,7 @@ Below is the full list of checks - it's basically the same as what is listed in
303303 - 🟡 **Not a fork** - Flags if the GitHub link is a fork instead of source
304304 - 🟡 **Has license** - Repo should include a license
305305 - 🟡 **Not archived** - Repo must not be archived
306 - 🟡 **No security alerts** - No open critical/high Dependabot alerts
306 - 🟡 **No security alerts** - No unpatched critical/high security advisories published for the repo
307307 - 🟡 **Security policy** - Repo should have a security policy (SECURITY.md) and/or private vulnerability reporting enabled
308308 - 🟡 **Minimum stars** - Repo should have ≥100 stars
309309 - 🟡 **Bus factor** - Flags if ≥96% of commits come from a single contributor (bots and AI excluded)
.github/workflows/pr-check.yml +1 −1
@@ -11,7 +11,6 @@ on:
1111permissions:
1212 contents: read
1313 pull-requests: read
14 security-events: read
1514
1615jobs:
1716 pr-compliance:
@@ -147,6 +146,7 @@ jobs:
147146 PR_USER: ${{ github.event.pull_request.user.login }}
148147 PR_BODY: ${{ github.event.pull_request.body }}
149148 GITHUB_TOKEN: ${{ github.token }}
149 API_TOKEN: ${{ secrets.API_TOKEN }}
150150 run: python lib/checks/check-project.py
151151 - name: Generate repo stats
152152 continue-on-error: true
lib/checks/check-project.py +13 −10
@@ -35,6 +35,7 @@ SPAM_WINDOW_DAYS = 2
3535NEW_ACCOUNT_DAYS = 14
3636
3737SESSION = utils.make_session(user_agent=USER_AGENT)
38API_TOKEN = os.environ.get("API_TOKEN", "")
3839
3940LINK_MSG = (
4041 "The link(s) you included seem to be returning a 404."
@@ -74,8 +75,8 @@ ARCHIVED_MSG = (
7475 " Additions must be actively maintained"
7576)
7677SECURITY_MSG = (
77 "This project has open security vulnerabilities (critical or high severity)"
78 " flagged by GitHub Dependabot. Please verify these have been addressed"
78 "This project has published security advisories (critical or high severity)"
79 " with no patched version listed. Please verify these have been addressed"
7980)
8081SPAM_AWESOME_MSG = (
8182 "You have made many similar submissions on other awesome-* repos today."
@@ -200,13 +201,15 @@ def check_ai_commits(owner, repo, token):
200201 return None
201202
202203
203def check_security_alerts(owner, repo, token):
204 """Return SECURITY_MSG if the repo has open critical/high Dependabot alerts."""
205 alerts = _gh_get(f"/repos/{owner}/{repo}/dependabot/alerts", token,
206 params={"state": "open", "severity": "critical,high", "per_page": 1},
207 label="dependabot")
208 if alerts:
209 return SECURITY_MSG
204def check_security_alerts(owner, repo):
205 """Return SECURITY_MSG if the repo has unpatched critical/high security advisories."""
206 try:
207 report = utils.fetch_security_report(owner, repo, API_TOKEN, session=SESSION,
208 timeout=TIMEOUT, label=f"{owner}/{repo}")
209 if utils.unpatched_advisories(report)[1]:
210 return SECURITY_MSG
211 except Exception as exc:
212 logger.warning("check_security_alerts error for %s/%s: %s", owner, repo, exc)
210213 return None
211214
212215
@@ -395,7 +398,7 @@ def check_repo_signals(diff, pr_user, token, pr_body=""):
395398 findings.append(finding)
396399
397400 if SECURITY_MSG not in findings:
398 finding = check_security_alerts(owner, repo, token)
401 finding = check_security_alerts(owner, repo)
399402 if finding:
400403 findings.append(finding)
401404