Skip to content

feat: leave alerts in archived repositories out of the security alerts report - #37

Merged
sgtoj merged 1 commit into
mainfrom
feat/skip-archived-repo-alerts
Dec 1, 2026
Merged

sgtoj merged 1 commit into
mainfrom
feat/skip-archived-repo-alerts

Conversation

@sgtoj

@sgtoj sgtoj commented Dec 1, 2026

Copy link
Copy Markdown
Member

The security alerts report now leaves out alerts in archived repositories by default. Nobody can fix those alerts without unarchiving the repo, so they were noise in every report.

GitHub's org-level alert listings don't say whether an alert's repository is archived. So when a run finds alerts, the client lists the org's repositories once (one request per 100 repos) and drops the alerts of archived ones. Runs without alerts skip the lookup, and names are compared case-insensitively.

  • Opt out: APP_SECURITY_ALERTS_INCLUDE_ARCHIVED_REPOS=true keeps them.
  • Visibility: the report counts what it left out, logs it as archived_alerts, and the Slack footer says "N more in archived repositories not shown" when there are any.
  • Failure: if the repositories can't be listed, every alert is kept and the error shows in the report, so a failed lookup never hides an alert.
  • Permissions: none new. Listing repositories uses the Metadata read access every GitHub App has.
  • Interface: ListSecurityAlerts now takes a domain.SecurityAlertsQuery instead of separate arguments.

After upgrading, the first report leaves the archived repos' alerts out. With APP_REPORT_REPEAT=daily that counts as a change, so it posts once right away.

Testing: make check passes (lint, unit and e2e tests, govulncheck, go mod tidy). New client tests cover the filtering, case differences, a two-page repository listing, the opt-out, the failed lookup, and skipping the lookup without alerts. The e2e scenario now has an alert in an archived repo that gets dropped. Not yet run against a real org.

cruxstack/terraform-aws-github-ops-app will follow with the matching input and a default of v1.3.0.

🤖 Generated with Claude Code

…s report

Alerts don't say whether their repository is archived, so when a run
finds alerts, the client lists the org's repositories once and drops the
alerts of archived ones, counting them; the Slack report notes how many it
left out. APP_SECURITY_ALERTS_INCLUDE_ARCHIVED_REPOS=true keeps them. If
the repositories can't be listed, every alert is kept and the error is
reported, so a failed lookup never hides an alert.

ListSecurityAlerts now takes a domain.SecurityAlertsQuery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sgtoj
sgtoj merged commit 6536466 into main Dec 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant