Skip to content

Instantly share code, notes, and snippets.

@norwd
norwd / keep-repo-private.yml
Last active November 27, 2024 03:13
Use GitHub Actions to keep a repo private even if made public manually.
---
on: public
jobs:
make-private:
runs-on: ubuntu-latest
steps:
- run: gh repo edit ${{ github.repository }} --visibility private --accept-visibility-change-consequences
env:
GH_TOKEN: ${{ secrets.KEEP_REPO_PRIVATE }}