Turn on the GitHub features a fork of the carnival needs (Issues, Actions and GitHub Pages) using the GitHub CLI, lock the fork down so only its owner can open issues, comment and open pull requests, then deploy the carnival and share its link. Use when someone asks to set up their fork, turn on issues or Pages, lock down their fork, get a shareable link to their carnival, or when the Issues tab, CI checks or the Pages deploy are missing on a fork.
76
95%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
GitHub switches a few features off when someone forks a repository. The workshop needs three of them. You turn them on with the person's own GitHub login, so they need to own the fork.
The fork is public, so you also lock it down: only the person and their collaborators can open issues, comment and open pull requests.
Tell the person what you're about to change before you change it.
This skill is safe to rerun. Every step sets a feature to a state, rather than adding something new, so running it again only renews the lock and redeploys the carnival.
gh auth status. If gh isn't installed or isn't logged in, stop and
give the person the manual steps at the end of this skill. Don't log in for
them: gh auth login is interactive.origin remote:
git remote get-url origin. Call it OWNER/REPO below.OWNER/REPO is tesslio/tessl-carnival (in any case), stop. That's the
upstream repository, and it has to stay open so people can post in Show your
carnival. Tell the person to fork it on GitHub and clone their fork, or to
run gh repo fork --remote in this clone to fork it and point origin at
their fork.gh repo view OWNER/REPO --json isFork,viewerPermission. Carry on only
if isFork is true and viewerPermission is ADMIN. Otherwise stop and say
why: these steps change settings on the person's own fork, never on the
repository they forked from.gh at the fork: gh repo set-default OWNER/REPO. This only changes
the local clone. If the person cloned with gh repo clone or
gh repo fork, the default is tesslio/tessl-carnival, so gh pr create
and gh issue create would land there instead of on their fork.Run each step, and keep going if one fails: note it for the summary.
gh repo edit OWNER/REPO --enable-issues.gh api repos/OWNER/REPO/actions/workflows --jq '.workflows[] | [.id, .name, .state] | @tsv'.
Enable any whose state isn't active with gh workflow enable <id> --repo OWNER/REPO.
If GitHub refuses, the person has to open the Actions tab once and
select the button to enable workflows.gh api -X POST repos/OWNER/REPO/pages -f build_type=workflow.
If that says Pages already exists, switch it to GitHub Actions instead:
gh api -X PUT repos/OWNER/REPO/pages -f build_type=workflow.Check again that OWNER/REPO isn't tesslio/tessl-carnival before either
call. Run both, and keep going if one fails: note it for the summary.
Interactions: limit issues, comments and pull requests to collaborators, for six months, the longest GitHub allows:
gh api -X PUT repos/OWNER/REPO/interaction-limits -f limit=collaborators_only -f expiry=six_monthsThe response has expires_at: note it for the summary. Running this again
starts a fresh six months. If GitHub answers 409, a limit is already set on
the person's whole account, so this repository can't have its own: say so.
Actions on outside pull requests: require approval before workflows run on pull requests from anyone outside the repository:
gh api -X PUT repos/OWNER/REPO/actions/permissions/fork-pr-contributor-approval -f approval_policy=all_external_contributorsCheck it with
gh api repos/OWNER/REPO/actions/permissions/fork-pr-contributor-approval --jq .approval_policy.
If either call fails, carry on: say so in the summary, and give the person
the manual step at the end of this skill.
gh workflow run pages.yml --repo OWNER/REPO --ref main.gh run list --workflow pages.yml --repo OWNER/REPO --limit 1 and follow it
with gh run watch <run id> --repo OWNER/REPO. It takes about a minute.gh api repos/OWNER/REPO/pages --jq .html_url.End with a short summary:
main redeploys it, so new games show up there once they merge.gh in this clone now works on their fork.expires_at date. The lock lasts six
months, and rerunning Set up my fork renews it. Say whether outside pull
requests need approval before Actions run, and anything that failed.If you can't use gh, give the person these steps for their fork on GitHub:
Their carnival is then at https://<their-username>.github.io/<repo>/.
hamzaoza/carnival-lock-test
6e4bba4
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.