Skip to content

FileSet

FileSet distributes files to multiple repositories with shared defaults. Use this when you have many repos that should contain identical files and want to avoid repeating the same configuration in every file. Each repository in the set receives the same files and can override specific ones.

metadata:
owner: babarot # GitHub owner or organization

All repositories in the set belong to this owner. Individual repo names are listed in spec.repositories.

All settings available in File — file sources, templating, reconcile modes, and delivery methods — work identically in FileSet. See the File documentation for details:

  • File Sources — Inline content, local files, directories, and github:// references
  • Templating<% %> syntax, built-in variables, custom vars
  • Patches — Unified diff patches for per-repo customization of shared templates
  • Reconcilepatch (add/update) vs mirror (add/update/delete orphans)
  • Delivery Methodpush vs pull_request

Suppose you manage 20 repositories that all need the same CODEOWNERS, LICENSE, and CI workflows. With individual File resources, you’d repeat those file definitions in every manifest:

repos/
├── my-cli-files.yaml # CODEOWNERS, LICENSE, ci.yml...
├── dotfiles-files.yaml # same CODEOWNERS, LICENSE, ci.yml...
├── blog-files.yaml # same CODEOWNERS, LICENSE, ci.yml...
└── ... (17 more files with the same content)

When you need to change a shared file — say, update the CODEOWNERS to add a new team member — you have to edit all 20 files. Miss one, and your repos drift out of sync.

FileSet solves this by declaring files once and distributing them to all target repositories. A single manifest replaces 20:

spec:
repositories:
- my-cli
- dotfiles
- blog
# ... 17 more repos
files:
# Change once, applies to all 20 repos
- path: .github/CODEOWNERS
content: |
* @babarot @new-team-member

FileSet isn’t always the right choice. Use separate File resources when:

  • Each repo has mostly unique files — the shared files block would be nearly empty, so there’s no benefit.
  • You need clean per-repo git blame — with FileSet, all repos share one manifest, so git blame shows who changed the file, not which repo was affected.
  • Different teams own different repos — separate files let each team manage their own config independently.
FileSetSeparate File resources
Shared filesWrite once in filesRepeated in every manifest
Adding a repoAdd 1 line to repositoriesCreate a new file with full spec
Changing a shared fileEdit one placeEdit every manifest
Per-repo git blameAll changes in one fileClean, one file per repo
Team ownershipSingle file, shared ownershipEach team owns their manifest