Install
openclaw skills install @wardlu/public-repo-git-gateRun the public-repository gates for Git commits, pushes, and pull requests. Check staged and untracked scope, secrets and personal data, internal material, branches and remotes, PR base/head, CI, and merge prerequisites. Use when the user asks to commit, push, open a PR, review public repository content, or run the complete public-repository gate.
openclaw skills install @wardlu/public-repo-git-gateTreat Git commits, remote pushes, and pull requests as sequential public-content
gates. .gitignore is not a security boundary; inspect what Git will actually
commit or has already put under version control.
Keep checks read-only by default. Passing a check does not authorize a commit, push, PR creation, or remote-branch update. The user must explicitly request those actions, which must also follow the repository's branch and approval rules.
Run the script from this skill directory. The three checks are not repeated full scans: commit checks inspect the index, push checks inspect changes from the base, and CI independently verifies the final PR head.
python3 scripts/public_repo_check.py --repo /path/to/repository --staged --require-feature-branch
Run the staged check before committing and the change/remote check before pushing:
python3 scripts/public_repo_check.py --repo /path/to/repository --staged --require-feature-branch
python3 scripts/public_repo_check.py --repo /path/to/repository --changed-since origin/main --check-remote
Use --all for a full baseline when introducing the gate, changing its rule
configuration, recovering from an accidental push, or preparing a Release.
Projects can add scoped exceptions and rules with
--config path/to/public-repo-gate.json. Keep the default rules conservative;
document each intentionally public special resource in project configuration
instead of disabling the entire check.
For a large repository, replace origin/main with the PR's exact base SHA. Do
not use an old local base. If the ref is missing, fail the check and synchronize
the base first rather than assuming that there are no changes.
| Stage | Scope | Checks | Target duration |
|---|---|---|---|
| commit | staged files | Paths, secrets, diff format, feature branch | Seconds, offline |
| push | base...HEAD changes | Incremental public-content scan and remote/branch/upstream checks | Seconds; no full test suite |
| PR | final head | Full CI security scan, lint, test, build, and PR diff review | CI-owned |
| Release | final artifacts and live state | Archives, licenses, tag, deployment, and attachments | Separate gate |
A passing commit check cannot replace remote push/PR confirmation, and an incremental push check cannot replace PR CI. Each layer should cover only its own responsibility.
git status --short --branch, the current branch, and the target PR
base. Do not commit ordinary changes directly to main or master.--staged check and git diff --cached --check. This is a
fast gate; do not require the full test suite for every commit.--changed-since origin/main --check-remote, then inspect recent commits
on the branch for content that should not be public. The script cannot prove
the hosting platform's repository visibility; confirm that setting manually.main directly.
Do not use --force to overwrite someone else's branch. History cleanup is
an exception requiring a local backup and an explicit recorded reason.main as the PR base and the feature branch as the head. Describe the
scope, risks, verification results, and unfinished work in the title and
body.main commit.Stop the current commit, push, or merge; do not commit first and explain later. Classify the finding as a false positive, a project-specific public resource, or content that should not be public. For a false positive, add the smallest scoped project configuration and retain the reason. For a real issue, unstage the content or remove it from the commit. Treat exposed secrets, personal data, or internal material as a security incident; rewriting branch history alone is not sufficient.
This skill covers commits, pushes, and PRs. Use the sibling
public-release-gate skill for tags, final installers, archives, GitHub
Release attachments, and production-deployment acceptance. Only both gates
together constitute a complete release review. Do not repeat the Release
artifact scan at every commit, push, and PR layer.