Repository navigation
security: enable Dependabot alerts and security updates (runbook + apply/verify script) - #498
Open
afeezorobsco-cyber wants to merge 1 commit into
Conversation
…ub-Rosa-Issue#486) Dependabot alerts and security updates are repository settings, so this change gives maintainers what they need to enable and verify them: - docs/DEPENDABOT_SECURITY.md: runbook covering the UI and API paths, verification, alert visibility and permissions, triage of security-update PRs, and the split from scheduled updates (Sub-Rosa-Issue#482). - scripts/dependabot-security.mjs: check (default) / --apply helper over `gh api` (vulnerability-alerts, automated-security-fixes). It is read-only unless --apply is passed. - scripts/dependabot-security.test.mjs: 13 node:test cases using a fake API. - package.json: dependabot:check, dependabot:apply, dependabot:test. - README: link the runbook from the documentation table. No dependency versions change. Closes Sub-Rosa-Issue#486 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@afeezorobsco-cyber Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #486
Summary
Dependabot alerts and Dependabot security updates are repository settings, not files, so a PR from a contributor cannot switch them on. This PR gives maintainers a documented, repeatable, and verifiable way to do it. Once merged, a maintainer with admin access runs one command (or clicks three toggles) and can confirm the result.
Current state, as seen from a non-admin account with
pnpm dependabot:check:(GitHub returns 404 both for "off" and for "no admin access", so a maintainer needs to confirm this.)
Changes
docs/DEPENDABOT_SECURITY.mdscripts/dependabot-security.mjs--applyenables alerts and then security updates throughgh api. It is read-only unless--applyis passed and stops if enabling alerts fails, because GitHub rejects security updates while alerts are off. It reportspausedand unknown states rather than treating them as enabled. It uses the repo's structured logger, sologging:checkpasses.scripts/dependabot-security.test.mjsnode:testcases against a fakegh api: state parsing (204/404/403/paused/private), evaluation, apply ordering and early stop, argument validation, exit codes, and a check that check mode never sends a write request.package.jsondependabot:check,dependabot:apply,dependabot:testREADME.mdAcceptance criteria
PUT /repos/{owner}/{repo}/vulnerability-alerts(pnpm dependabot:apply) or Settings → Advanced Security.PUT /repos/{owner}/{repo}/automated-security-fixes, applied after alerts.Maintainer action after merge⚠️
This PR cannot flip the settings itself. With an admin account:
Or use the UI: Settings → Advanced Security → Dependabot alerts: Enable → Dependabot security updates: Enable.
Testing
Related
.github/dependabot.yml), kept separate on purpose🤖 Generated with Claude Code