publish-snapshot Action
publish-snapshot Action
Section titled “publish-snapshot Action”A dedicated composite Action for rrt git publish-snapshot — force-pushing a
single-commit, no-history snapshot of tracked content to a secondary remote
(e.g. a public downstream mirror of a privately developed repository).
Overview
Section titled “Overview”Use this Action to refresh a public mirror from a private repository. It
force-pushes one commit with no history to the remote named by target.
Resolve the remote, branch, message, and excludes from a
[tool.rrt.publish_targets.<name>] config entry.
It is deliberately not part of the main repo-release-tools Action.
That action is a set of read-only, idempotent policy checks meant to run on
every PR. publish-snapshot is destructive and belongs on a different
trigger. Use push-to-main, a schedule, or workflow_dispatch. Keeping it in
its own composite action isolates that risk profile.
Examples
Section titled “Examples”name: Refresh public mirror
on: push: branches: [main] workflow_dispatch: {}
jobs: publish-snapshot: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 with: fetch-depth: 0
- uses: Anselmoo/repo-release-tools/actions/publish-snapshot@v1.18.0 with: target: public-preview confirm: "true"Inputs
Section titled “Inputs”| Input | Default | Description |
|---|---|---|
target |
— (required) | Named [tool.rrt.publish_targets.<name>] entry to resolve remote/branch/message/exclude from |
confirm |
"false" |
Set "true" to actually force-push; otherwise this only previews with --dry-run |
python-version |
"3.12" |
Python version used to run repo-release-tools |
working-directory |
"." |
Repository path to install and run repo-release-tools from |
Caveats
Section titled “Caveats”Force-pushing does not immediately purge old objects on the remote host.
They can remain fetchable by direct SHA until the host runs garbage
collection. If secrets were ever committed, run git filter-repo or the BFG
Repo-Cleaner first. This action only controls what is visible going forward.
Clones or forks made before the force-push retain the old history locally,
which is outside this tool’s control. Always run with confirm: "false"
(the default) first and inspect the dry-run output before flipping it on.
Related docs
Section titled “Related docs”- GitHub Action for the read-only policy checks that run on every PR
- rrt CLI for the underlying
rrt git publish-snapshotcommand
Badge families are intentionally complete for the current icon registry across platform, registry, and language labels; see src/repo_release_tools/tools/platform.py if you think one is missing.
Chat is powered by Context7, a third-party service with its own terms and privacy policy.