github-repo-lockdown
Skill0 starsChanged 23 days agoMITView on GitHub
Use when public GitHub repos must be fork-only: strangers can read, fork and download releases but not push, open issues, comment or open PRs. gh commands, limits, renewal workflow, pitfalls.
- Reads credentials
In this repository69 other files it gives its agents.
- ableton-liveSkill
- ableton-push-expertSkill
- ardourSkill
- arduino-electronics-solderingSkill
- audacitySkill
- audio-driver-stacksSkill
- audio-interface-digital-ioSkill
- av-receiver-specialistSkill
- bazzite-kde-linuxSkill
- bitwig-studioSkill
- color-palette-expertSkill
- couch-pc-cec-gaming-modeSkill
- cubaseSkill
- daw-hubSkill
- denon-prime-sc5000-x1800Skill
- design-software-guideSkill
- dj-gig-guideSkill
- dj-specialistSkill
- drawing-tabletsSkill
- dsp-references-and-licencesSkill
- electronic-music-producerSkill
- fl-studioSkill
- fx-plugin-designSkill
- gha-supply-chain-hardeningSkill
- github-for-beginnersSkill
- grapheneosSkill
- graphic-design-expertSkill
- hard-dance-productionSkill
- hardstyle-sound-design-notesSkill
- hardware-protocol-captureSkill
- home-network-specialistSkill
- js-to-cpp-dsp-portSkill
- juce-audio-thread-handoffSkill
- juce-expertSkill
- juce-headless-test-snapshotSkill
- knulli-handhelds-m8Skill
- korg-logue-sdk-expertSkill
- linux-audio-productionSkill
- linux-expertSkill
- linux-security-hardeningSkill
- linux-terminal-expertSkill
- logic-proSkill
- loudness-and-lowend-deliverySkill
- man-page-expertSkill
- max-for-live-expertSkill
- mockup-is-the-pluginSkill
- mockup-to-juce-layoutSkill
- nextcloud-specialistSkill
- photo-editing-color-gradingSkill
- pihole-raspberry-piSkill
- plugin-dsp-qualitySkill
- plugin-fleet-auditSkill
- plugin-performance-profilingSkill
- plugin-security-fuzzingSkill
- plugin-ship-checklistSkill
- pro-toolsSkill
- reaperSkill
- rog-ally-x-bazziteSkill
- sound-engineer-acousticsSkill
- sound-forgeSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Test on ONE repo first:
- Distinctive: line 26
All three worked on public repos.
- Very specific: line 28
Check without a token: curl -s https://api.github.com/repos/OWNER/REPO and read has_issues, pull_request_creation_policy.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub repo lockdown: read, fork, download, nothing else
Companion to github-expert and github-for-beginners. Labels: MEASURED (done on 66 real repos in one session), VERIFIED (read on a source page), UNVERIFIED (believed, test first).
What strangers can still do, and what you can switch off
- Forking a public repo cannot be turned off. UNVERIFIED here, believed from GitHub docs. That is the intended "fork it and make it yours" path.
- Pushing is already impossible for people who are not collaborators. Never add collaborators you do not want.
- Switch off the rest per repo: issues, wiki, projects, discussions, and pull request creation.
Commands (run on your own computer where gh auth login is done with your account)
Cloud coding sessions cannot do this: the session proxy answered Repository settings writes are not permitted through this proxy (HTTP 403). MEASURED. A GitHub token cannot be saved for api.github.com in such a session either.
- Test on ONE repo first:
R=OWNER/REPO
gh api -X PATCH repos/$R -f pull_request_creation_policy=collaborators_only --jq .pull_request_creation_policy # prints collaborators_only
gh api -X PUT repos/$R/actions/permissions/fork-pr-contributor-approval -f approval_policy=all_external_contributors && echo ok
gh api -X PUT repos/$R/branches/main/protection --input - <<'EOF2'
{"required_status_checks":null,"enforce_admins":false,"required_pull_request_reviews":null,"restrictions":null,"allow_force_pushes":false,"allow_deletions":false}
EOF2All three worked on public repos. MEASURED.
2. Then every repo: gh repo list OWNER --source --no-archived -L 200 --json name --jq '.[].name' in a for loop, with gh api -X PATCH repos/OWNER/$R -F has_issues=false -F has_wiki=false -F has_projects=false -F has_discussions=false.
3. Check without a token: curl -s https://api.github.com/repos/OWNER/REPO and read has_issues, pull_request_creation_policy. MEASURED.
Known errors, all harmless
- Private repos:
Fork PR approval is not allowed for private repositories, and branch protection saysUpgrade to GitHub Proon a free plan. Private repos cannot be forked by strangers anyway. MEASURED. - macOS
base64has no-w0. Usebase64 -i file | tr -d '\n'. An upload with a blankcontentcreates an EMPTY file and succeeds silently; fix it with a PUT that passes the file's currentsha. MEASURED. - A
PUT contentson an existing file withoutshafails with 422, and with a staleshawith 409. MEASURED.
Comments on commits and the six month limit
- Interaction limits:
gh api -X PUT repos/OWNER/REPO/interaction-limits -f limit=collaborators_only -f expiry=six_months. Six months is the longest expiry, so it must be renewed. Whether it also covers comments on commits is UNVERIFIED. - Renew automatically on GitHub: a scheduled workflow in a repo you own, using a secret
LOCK_TOKEN(classic token,reposcope, no expiration; create at github.com/settings/tokens/new, store withgh secret set LOCK_TOKEN --repo OWNER/.github). The defaultGITHUB_TOKENcannot change repo settings. MEASURED (the run was started; it loops over every public repo). - GitHub disables scheduled workflows in public repos after 60 days without repo activity. A final step that calls
PUT /repos/{repo}/actions/workflows/{file}/enableis meant to prevent that. UNVERIFIED, check Actions after about two months.
Message to outsiders
- Put a short
CONTRIBUTING.mdin the account's.githubrepo (default for every repo without its own). Say: forks welcome, no outside contributions, provided as is. Do not promise a security contact you do not want. Repos whose name starts with a dot cannot be attached to cloud coding sessions, so edit that one withgh api -X PUT repos/OWNER/.github/contents/CONTRIBUTING.md. MEASURED. - Private vulnerability reporting is optional and invites mail. Leave it off if you do not want to deal with reports.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

