Safeguard
Security Guides•

Who should be allowed to edit your organization workflow templates?

Your .github template repository sets the starting point for new CI files. Limit who can change it, require review, and keep an audit trail of every edit.

Safeguard Security Team
3 min read

Give edit rights to a small platform or security group, require a reviewed pull request for every change, and add code owners on the templates directory. The template repository shapes every new workflow in the organization, so its access list deserves the same care as a production deploy repository.

Why this repository matters

When your organization publishes templates, each one is a workflow file inside a .github repository, in a workflow-templates directory. Teams pick a template, GitHub copies it into their repository, and from then on it runs with that repository's token and secrets.

So a change to a template does not affect running pipelines directly. It changes what the next dozen repositories start with. A subtle edit, such as a widened permissions block or an extra download step, can spread without anyone noticing until teams adopt it.

A realistic access model

RoleAccess to template repoWhy
Platform or security ownersWrite, via pull requestThey maintain the defaults
Team leadsRead, can open pull requests from forks or branchesThey can propose changes
All developersReadThey need to see what they copy
Automation accountsNone, unless a documented need existsFewer paths to abuse

Keep the write group small enough that you can name every member.

Controls to switch on

  1. Branch protection. Require pull requests for the default branch, and require at least one approving review.
  2. Code owners. GitHub documents CODEOWNERS as a way to require approval from a designated reviewer for changes to files such as those under the workflows directory. Apply it to workflow-templates too.
  3. Dependabot for actions. If your templates call actions, GitHub notes Dependabot can keep those references current through reviewed pull requests.
  4. Scanning. GitHub says CodeQL can scan workflow files and Scorecards can flag risky patterns. Run them on the template repository itself.
  5. A review checklist. Write down what reviewers must check: permissions, triggers, pinned actions, secrets, downloads.

What reviewers should look for

  • A top level permissions block present, with read access to contents.
  • No pull_request_target or workflow_run unless there is a documented reason.
  • No expressions that place event data directly inside shell lines.
  • Every action pinned and from an approved owner.
  • No hard coded credentials or hosts.

For the broader review pattern, see how to review a GitHub Actions workflow change.

Audit and communication

Use pull request titles that say what changed and why. When a template changes in a way that existing repositories should copy, write a short note and send it to the teams. Since templates do not update repositories already created, communication is your update mechanism.

Quick check

Should security approve every template change?

For changes to permissions, triggers, secrets or downloads, yes. Pure wording changes can go through a lighter review.

Can a developer bypass a template by writing their own workflow?

Yes. Templates guide new workflows but do not enforce anything. If you need enforcement, use organization level Actions policies, not templates alone.

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.