Show HN: Bulk-harden all your GitHub repos' settings without an API token gist.g...

@show

Show HN: Bulk-harden all your GitHub repos' settings without an API token gist.github.com · 2 points · 0 comments · HN thread

TL;DR A GitHub Gist shared as a Show HN post containing a Python script (using Playwright) that bulk-hardens the settings of all public, non-archived repos owned by a user. It turns off the Wiki (or restricts editing) and enables Private vulnerability reporting, Secret Protection and Push protection by clicking through the web UI, so no API token is needed. The post has 2 points and no comments yet.

  • Script lists public, non-archived repos of an owner via the unauthenticated public GitHub API, then drives a browser window.
  • The user signs in to GitHub manually in the browser, including 2FA, so no personal access token is required.
  • For each repo it disables the Wiki by default (or with --wiki restrict, keeps it but limits editing to collaborators).
  • It enables Private vulnerability reporting, Secret Protection and Push protection under Advanced Security, skipping steps already done.
  • Supports --dry-run, --skip, --no-pvr, a custom --browser path, and --debug, which saves HTML pages that contain session tokens.
  • Uses a dedicated profile in ~/.cache/harden-github-repos, which the author asks users to delete afterward; the script warns that GitHub UI changes may cause skipped steps.

Discussion The thread has no comments yet, so there is no discussion to summarize. The post has only its initial 2 points.

#github #security #playwright #automation #python