GitHub Platform
platform.github
Protects against destructive GitHub CLI operations like changing repository visibility or deleting repositories, gists, releases, or SSH keys.
- 20blocking rules
- 13safe patterns
- 19High
- 1Medium
[packs]
enabled = ["platform.github"]Evaluated when a command contains gh, curl.
Recorded verdicts
gh repo delete acme/api --yesBlockedplatform.github:gh-repo-delete
Blocking rules
Each rule ID is platform.github:<name>. Use it in allowlists and [policy.rules].
Highcurl-api-delete-repocurl DELETE /repos/{owner}/{repo} permanently deletes a GitHub repository. This cannot be undone.
Explanation
This is the REST spelling of `gh repo delete`. It removes the code, issues, pull requests, releases, wiki, and Actions history together. GitHub can restore a deleted repository only within 90 days, only if the name has not been reused, and only via support. Safer alternatives: - gh api -X PATCH repos/<owner>/<repo> -F archived=true: read-only, via the API - gh repo view: confirm the target first
Highgh-api-delete-actions-secretgh api DELETE actions/secrets removes GitHub Actions secrets.
Explanation
Secret values are write-only, so a deleted secret cannot be read back or restored. Every workflow referencing it fails on the next run. Safer alternative: - gh secret set <NAME>: rotate the value in place via the first-class verb
Highgh-api-delete-actions-variablegh api DELETE actions/variables removes GitHub Actions variables.
Explanation
Workflows referencing a missing variable resolve it to an empty string rather than failing loudly, so the breakage is easy to miss. Safer alternative: - gh variable set <NAME>: update the value via the first-class verb
Highgh-api-delete-deploy-keygh api DELETE keys removes deploy keys.
Explanation
Deploy keys are how servers and CI clone this repository without a user account. Removing one breaks those consumers immediately, usually surfacing on someone else's next deploy. Confirm what depends on it: gh repo deploy-key list
Highgh-api-delete-genericgh api DELETE calls can be destructive. Please verify the endpoint.
Explanation
This is the catch-all for raw-API deletions whose endpoint this pack does not recognize, so the blast radius is unknown rather than known-large — it covers both `DELETE /repos/{owner}/{repo}` scale operations and routine ones like removing a label or an assignee. Before reaching for a raw API DELETE, check whether `gh` has a first-class verb for it: those are more readable, and several are allowed outright. For example, sub-issue hierarchy has dedicated verbs: - gh issue edit <child> --remove-parent - gh issue edit <parent> --remove-sub-issue <number> Preview what the endpoint returns before deleting it: gh api <endpoint>
Highgh-api-delete-hookgh api DELETE hooks removes repository webhooks.
Explanation
Removing a webhook silently stops every downstream integration it feeds — CI triggers, chat notifications, deployment hooks. Nothing errors; events simply stop arriving, so the failure surfaces late and somewhere else. Inspect first, and note the config so it can be recreated: gh api repos/<owner>/<repo>/hooks
Highgh-api-delete-releasegh api DELETE releases removes GitHub releases.
Explanation
Deleting a release destroys its uploaded assets. Install scripts and pinned CI jobs that fetch by that release URL start getting 404s immediately. Safer alternative: - gh release edit <tag> --draft: unpublish while keeping the assets
Highgh-api-delete-repogh api DELETE /repos/{owner}/{repo} permanently deletes a GitHub repository. This cannot be undone.
Explanation
This is the raw-API spelling of `gh repo delete`. It removes the code, issues, pull requests, releases, wiki, and Actions history together. GitHub can restore a deleted repository only within 90 days, only if the name has not been reused, and only via support. Safer alternatives: - gh api -X PATCH repos/<owner>/<repo> -F archived=true: read-only, via the API - gh repo archive: the same thing via the first-class verb (dcg gates that one too, but archiving is reversible)
Highgh-gist-deletegh gist delete permanently deletes a Gist.
Explanation
Gist deletion is immediate and permanent — there is no trash and no support-side restore. Any URL you have shared, and anything embedding the Gist, breaks at once. Save the contents first: gh gist view <id> > backup.txt
Highgh-issue-deletegh issue delete permanently deletes an issue.
Explanation
Issue deletion is permanent and takes the whole discussion thread with it. Almost every reason to delete an issue is better served by closing it, which preserves the history and the cross-references other issues rely on. Safer alternative: - gh issue close <number> --reason 'not planned'
Highgh-release-deletegh release delete permanently deletes a release.
Explanation
Deleting a release destroys its uploaded assets. Anyone installing by that release URL — install scripts, CI pipelines, package managers pinned to it — starts getting 404s immediately, and the binaries cannot be recovered unless you still have them locally. Safer alternative: - gh release edit <tag> --draft: unpublish while keeping the assets
Highgh-repo-archivegh repo archive makes a repository read-only. While reversible, it stops all write access.
Explanation
Archiving is reversible, but until it is reversed nobody can push, open issues, or comment, and automation that writes to the repository starts failing. Unarchive from the web UI (Settings) or with the REST API. Reverse it with: gh api -X PATCH repos/<owner>/<repo> -F archived=false
Highgh-repo-deletegh repo delete permanently deletes a GitHub repository. This cannot be undone.
Explanation
Deleting a repository removes its code, issues, pull requests, releases, wiki, and Actions history together. GitHub can restore a deleted repository only within 90 days, only if the name has not been reused, and only via support — it is not a self-service undo. Safer alternatives: - gh repo archive: makes it read-only while keeping everything visible (dcg gates this one too, but it is reversible) - gh repo view: confirms the target before any destructive action
Highgh-repo-deploy-key-deletegh repo deploy-key delete removes a deploy key and can break access.
Explanation
Deploy keys are how servers and CI clone this repository without a user account. Removing one breaks those consumers immediately, and the failure usually surfaces on someone else's next deploy rather than here. Confirm what depends on it: gh repo deploy-key list
Highgh-repo-visibility-changegh repo edit --visibility changes repository visibility and can remove stars or detach forks.
Explanation
Changing repository visibility has consequences beyond access control. GitHub warns that a transition can remove stars and watchers, detach public forks, disable push rulesets, and expose Actions history or logs to newly eligible users. Treat every visibility transition as a consequential repository mutation and obtain explicit approval for the exact repository and target visibility.
Highgh-run-cancelgh run cancel stops a workflow run and may interrupt deployments.
Explanation
Cancelling mid-run can leave a deployment half-applied: a job that has already pushed some resources stops before its cleanup or rollback steps. Check what the run is doing before stopping it. Inspect first: gh run view <run-id>
Highgh-secret-deletegh secret delete removes GitHub Actions secrets.
Explanation
Secret values are write-only — GitHub will not show you the value, so a deleted secret cannot be restored unless you hold it somewhere else. Every workflow referencing it starts failing on the next run, often mid-deploy. Safer alternative: - gh secret set <NAME>: rotate the value in place, no window with it missing
Highgh-ssh-key-deletegh ssh-key delete removes an SSH key, potentially breaking access.
Explanation
Removing an SSH key takes effect immediately for every machine using it. If it is the key for the session you are in, or the only key on a remote host, you lose git push/pull access and may lock yourself out of automation that authenticates with it. Confirm which key you are about to remove: gh ssh-key list
Highgh-variable-deletegh variable delete removes GitHub Actions variables.
Explanation
Workflows referencing the variable resolve it to an empty string rather than failing loudly, so the breakage can be silent — a deploy target or feature flag quietly becomes blank. Safer alternative: - gh variable set <NAME>: change the value without a window where it is unset
Mediumgh-release-delete-assetgh release delete-asset permanently deletes an uploaded release asset.
Explanation
The release itself stays published, but the named asset is removed immediately and cannot be restored from GitHub. Anything downloading that asset by URL — install scripts, CI pipelines, package managers pinned to it — starts getting 404s until an identical file is re-uploaded. Safer alternatives: - gh release download <tag> --pattern <asset>: keep a copy first - gh release upload <tag> <file> --clobber: replace the asset in place
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
gh-repo-list-viewgh-gist-list-viewgh-release-list-viewgh-issue-list-viewgh-ssh-key-listgh-secret-listgh-variable-listgh-auth-statusgh-statusgh-api-explicit-getgh-helpgh-help-shortgh-help-topic