Safeguard
Developer Tools•

How do you test a public CI template in a throwaway repository?

A disposable repository lets you watch what a CI template does before it touches real secrets. Setup steps, what to observe, and when to promote it.

Safeguard Security Team
4 min read

Create an empty repository with no secrets and no deploy keys, add the template, push a trivial project, and read the run logs. Watch network calls, files written and what each action does. Promote the workflow to your real repository only after the trial matches your expectations and a reviewer agrees.

Why a throwaway repo

A workflow runs with a token and can reference any secret in its repository. GitHub's secure use guidance says a compromise of one action in a workflow can reach every secret configured on the repository. If you try an unfamiliar template in your real repository, you are testing it with real stakes. A disposable repository removes the stakes.

It also gives you a clean place to read logs without noise from your other workflows.

Set it up

  1. Create the repository. Make it private, or public if your template depends on that. Give it a name that makes its purpose obvious, such as ci-template-trial.
  2. Add no secrets. If the template asks for one, create a dummy value. You are testing the shape of the pipeline, not the real deployment.
  3. Keep the token narrow. Set the default token permission to read in the repository settings, so the trial matches what you plan for production.
  4. Add a small sample project. A hello world app in the template's language is enough.
  5. Add the template. Use the Actions tab, pick the template, and commit it.

What to watch in the run

ObserveWhere to lookWhat a surprise looks like
Outbound downloadsStep logsA tool fetched from an unfamiliar host
Secret handlingEnv and log outputA secret echoed or sent in an argument
Files writtenWorkspace listing stepUnexpected files or archives
Actions executedSet up job logAn action you did not expect to see
DurationRun summaryA job running far longer than the work warrants

GitHub advises reading workflow logs after testing valid and invalid inputs, because tools can send errors to standard output or standard error in unexpected ways. Run the workflow once with passing input and once with a deliberate failure, such as a broken test.

Try the abuse cases

Open a pull request from a branch with a deliberately odd title, for example one containing quotes and a harmless command word. GitHub's script injection page shows how a crafted title can break out of an inline script. If your template places event data directly in a run line, the test pull request will show it. Our guide on the intermediate environment variable fix covers the repair.

Also try opening a pull request from a fork account, if you have one, and confirm the run has read only access and no secrets, as GitHub documents for the pull_request event.

Decide and promote

Move the workflow to the real repository when:

  1. Every action it runs is known, pinned and approved.
  2. The permissions block is minimal.
  3. The logs show nothing unexpected.
  4. A second person has read the YAML.

Bring it in through a pull request with notes on what you tested. Then delete the trial repository so no stale credentials or workflows linger.

Quick check

Is a private trial repository enough to be safe?

It limits what the template can reach, but the runner still has network access. Do not put real credentials in it.

Do I need to repeat the trial for each template update?

For changes to actions, permissions, triggers or downloads, yes. A quick repeat takes minutes.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.