### Install signoff ruleset per branch with gh signoff install Source: https://github.com/basecamp/gh-signoff/blob/main/README.md Run once per protected branch to migrate from legacy branch protection to a ruleset. Existing signoff contexts carry over; customized branch protection is left intact and a warning is shown. Use `--branch other` to target a specific branch. ```bash gh signoff install ``` ```bash gh signoff install --branch other ``` -------------------------------- ### Install signoff ruleset to require signoff for PR merges Source: https://github.com/basecamp/gh-signoff/blob/main/README.md Run `gh signoff install` to create a repository ruleset named `signoff` (or `signoff ()` for a non-default branch) that requires the signoff commit status and blocks force pushes and branch deletion. Repository admins can bypass it. The ruleset layers alongside other rulesets; gh-signoff only manages its own signoff checks. If the branch later becomes the default, running `install` again rewrites the older `signoff ()` ruleset to the canonical `signoff` shape. ```bash # Require signoff to merge PRs gh signoff install ``` -------------------------------- ### Install and sign off Source: https://github.com/basecamp/gh-signoff/blob/main/README.md Install the gh-signoff extension and sign off on a PR when tests pass. Without -f, signoff requires HEAD to be contained in @{push}; if @{push} doesn't resolve, it falls back to @{upstream} only in the narrow centralized case and otherwise refuses. CI worktrees may want `git config push.default upstream`. ```bash # Install the extension gh extension install basecamp/gh-signoff # When your tests pass, sign off on your PR gh signoff ``` -------------------------------- ### Require partial signoff Source: https://github.com/basecamp/gh-signoff/blob/main/README.md Install partial signoff requirements for the default branch or a specific branch, check if partial signoff is required, and uninstall a context without affecting others. ```bash # Require partial signoff for the default branch gh signoff install security # Require multiple signoffs at once gh signoff install tests lint security # With a specific branch gh signoff install --branch main tests lint security # Check if partial signoff is required gh signoff check tests gh signoff check --branch main tests lint security # Stop requiring a context without touching the others gh signoff uninstall lint ``` -------------------------------- ### Add shell completion to startup file Source: https://github.com/basecamp/gh-signoff/blob/main/README.md Add this line to your shell startup file (e.g. ~/.bashrc) to enable tab completion for gh signoff. The emitted script wraps gh's own completion, handling gh signoff itself and delegating everything else. Place it after gh's own completion line if present, as the last registered wins. ```bash eval "$(gh signoff completion)" ``` -------------------------------- ### Set the Details link target URL Source: https://github.com/basecamp/gh-signoff/blob/main/README.md Provide a target_url for the GitHub commit status Details link. --url wins over the signoff.url config; only http(s) URLs are accepted, and a bad signoff.url is refused before posting. Without either, the status carries no target_url. ```bash gh signoff --url "$RUN_URL" # this signoff's run git config signoff.url https://ci.example.com/runs # a repo-wide default ``` -------------------------------- ### Sign off on CI steps Source: https://github.com/basecamp/gh-signoff/blob/main/README.md Use partial signoff to reflect each CI step, build platform, or signoff role. Sign off on individual contexts or all at once. ```bash # Sign off on CI steps gh signoff tests # Tests are green gh signoff lint # Linting checks pass gh signoff security # Security scan is happy # Or all at once gh signoff tests lint security ``` -------------------------------- ### Report a failure with gh signoff fail Source: https://github.com/basecamp/gh-signoff/blob/main/README.md Leave a visible red status when a run fails, especially on a CI runner. No cleanliness check or git identity is needed; the only requirement is that GitHub knows the commit. The default description is `: CI failed` or `CI failed`; GitHub caps descriptions at 140 characters. ```bash gh signoff fail gh signoff fail tests # a partial context gh signoff fail --commit abc1234 --description "suite exploded" gh signoff fail --commit "$SHA" --url "$RUN_URL" # from a CI runner, linking its run ``` -------------------------------- ### Check signoff status with partial signoff Source: https://github.com/basecamp/gh-signoff/blob/main/README.md With partial signoff, the status output lists each context with a checkmark or cross. ```bash gh signoff status ✓ signoff ✓ tests ✗ lint ✗ security ``` -------------------------------- ### Uninstall signoff contexts with gh signoff uninstall Source: https://github.com/basecamp/gh-signoff/blob/main/README.md Run `gh signoff uninstall` with a context name to stop requiring signoff on that context while keeping the rest of the ruleset. Running it without arguments removes the signoff requirement entirely. Context names are case-insensitive, so `uninstall tests` also removes a `signoff/Tests` requirement. ```bash gh signoff uninstall tests # stop requiring signoff on tests, keep the rest ``` ```bash gh signoff uninstall # remove the signoff requirement entirely ``` -------------------------------- ### List required status-check contexts Source: https://github.com/basecamp/gh-signoff/blob/main/README.md Lists the branch's required status-check contexts, one exact full name per line on stdout. Use --branch to specify another branch. Human-readable hints and the not-required verdict go to stderr. Required names that gh-signoff couldn't operate (containing quote, backslash, or control character) are skipped with a count on stderr. ```bash gh signoff contexts signoff signoff/tests signoff/qa review ``` -------------------------------- ### Check signoff status for current commit Source: https://github.com/basecamp/gh-signoff/blob/main/README.md Check whether you've signed off on the current commit. Output shows a checkmark for the overall signoff. ```bash gh signoff status ✓ signoff ``` -------------------------------- ### Check signoff status for a specific commit Source: https://github.com/basecamp/gh-signoff/blob/main/README.md Check signoff status for a specific commit using the --commit flag. Output shows a checkmark for the overall signoff. ```bash gh signoff status --commit abc1234 ✓ signoff ``` -------------------------------- ### Sign off on a specific commit with --commit Source: https://github.com/basecamp/gh-signoff/blob/main/README.md Target a commit other than HEAD, useful for stacked or virtual branches (e.g., GitButler). --commit accepts anything git rev-parse resolves; the commit must be on a remote, otherwise -f is needed. ```bash gh signoff --commit abc1234 gh signoff --commit HEAD~1 tests gh signoff status --commit abc1234 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.