set-up-github
Set up a GitHub repository for trunk-based development. Squash-only merges with the PR title as the commit title, head branches deleted on merge, and a pull request required for the default branch. When the repo has CI, also requires named checks to pass and the branch to be up to date before merge. Use only when the user explicitly asks to set up GitHub.
- License 许可
- MIT
- 最近更新
- 2026-11-02
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- set-up-github
- license
- MIT
- description
- Set up a GitHub repository for trunk-based development. Squash-only merges with the PR title as the commit title, head branches deleted on merge, and a pull request required for the default branch. When the repo has CI, also requires named checks to pass and the branch to be up to date before merge. Use only when the user explicitly asks to set up GitHub.
- compatibility
- Claude Code, GitHub Copilot CLI
- disable-model-invocation
- true
02 资源文件 1
- 脚本scripts/set-up-github.sh5.4 KB
03 SKILL.md 正文
Set up GitHub
Run this skill by hand from the repository you want to configure, once per repository. It changes settings on GitHub, not the local clone, so it does not need to run again in other clones. It needs gh logged in with admin rights on the repository, and jq installed.
The script is scripts/set-up-github.sh in this skill's folder, the folder that holds this SKILL.md. Run it with the repository as the working directory.
What it sets
- Merge settings: squash merges only. The squash commit title is the PR title and the body is blank. Head branches are deleted after merge. Other settings are left as they are.
- Ruleset
trunk-basedon the default branch: changes go through a pull request, and squash is the only allowed merge method. No approvals are required, which suits a single maintainer. The ruleset has no bypass actors, so direct pushes to the default branch are blocked for everyone. - CI gate, only when CI exists: each named check must pass before merge, and the branch must be up to date with the default branch first. GitHub only enforces "up to date" when at least one required check exists.
Steps
-
Find the CI checks. Run
scripts/set-up-github.sh --discover-checks. It lists the check names reported on the default branch.- If it lists names, show them to the user and ask which ones must pass before merge. Use only names the user picks, and pass each one with
--check NAME. Do not guess names. - If it says no check runs exist, the repository has no CI reporting yet. Continue without
--check. Tell the user the CI gate and the up-to-date rule are skipped, and that they apply once a CI job exists and this skill is run again. - Done when you have the check names, or the user has chosen none.
- If it lists names, show them to the user and ask which ones must pass before merge. Use only names the user picks, and pass each one with
-
Dry run. Run
scripts/set-up-github.sh --dry-runwith the same--checkflags. It prints the settings and ruleset it would apply and changes nothing. Show the output to the user and wait for them to confirm.- Done when the user has confirmed. If they decline, stop.
-
Apply. Run
scripts/set-up-github.shwith the same--checkflags. It updates the repository settings, then creates the ruleset, or updates it if one namedtrunk-basedalready exists. Running it again is safe.- If the script stops after the settings step, say which step failed. The repository settings may already have changed, and the ruleset may not exist. Report the error text and stop. Do not retry blindly.
- A private repository on a plan without rulesets returns an error from the ruleset step. Report it. The settings step has already run.
-
Report. Print the script's verification lines. Say which parts were skipped and why. Remind the user that a required check name must match the check run name exactly. If the name never reports, pull requests wait forever, so it is worth checking the first PR after setup.
- Done when the report is written.
04 同仓库更多 Skills
sopra-steria-brand
Apply Sopra Steria brand styling to a presentation, document, web page, diagram, or other artifact when the user explicitly wants Sopra Steria branding or refers to Sopra Steria brand rules, colors, typography, logo usage, or corporate visual identity. Do not use for generic design polish or unrelated branding work.
skill-creator
Create, review, and improve skills in this repository for GitHub Copilot CLI and Claude Code. Use when drafting a new skill, revising an existing skill under plugins/my-plugin/skills/, tightening trigger boundaries, or making a skill leaner and more portable.
set-up-workflow
Set up how this repo's issues and tickets are handled. Runs setup-matt-pocock-skills, then records the spec and ticket workflow under "Issue tracker" in AGENTS.md. Use only when the user explicitly asks to set up the workflow.
set-up-my-plugin
Copy the minimalist-engineering principles into the user-level instruction files for Claude Code and Copilot CLI.
set-up-hooks
Set up recommended git hooks in the current repository. Strips Claude and Copilot co-author lines from commit messages, and runs the repo's tests before each commit when it has any. Use only when the user explicitly asks to set up hooks.
minimalist-engineering
Keep code minimal and avoid over-engineering.