
Git SyncNamespaceFiles
CertifiedSync Namespace Files from Git
Git SyncNamespaceFiles
Sync Namespace Files from Git
Imports Namespace Files from a Git branch into a Kestra namespace. Can delete files missing in Git, honors .kestraignore, and supports dry-run diff output.
type: io.kestra.plugin.git.SyncNamespaceFilesExamples
Sync Namespace Files from a Git repository. This flow can run either on a schedule (using the Schedule trigger) or anytime you push a change to a given Git branch (using the Webhook trigger).
id: sync_from_git
namespace: company.ops
tasks:
- id: git
type: io.kestra.plugin.git.SyncNamespaceFiles
namespace: prod
gitDirectory: _files
delete: true
url: https://github.com/kestra-io/flows
branch: main
username: git_username
password: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
dryRun: true
triggers:
- id: every_minute
type: io.kestra.plugin.core.trigger.Schedule
cron: "*/1 * * * *"
Sync all flows and scripts for selected namespaces from Git to Kestra every full hour. Note that this is a System Flow, so make sure to adjust the Scope to SYSTEM in the UI filter to see this flow or its executions.
id: git_sync
namespace: company.ops
tasks:
- id: sync
type: io.kestra.plugin.core.flow.ForEach
values: ["company", "company.team", "company.analytics"]
tasks:
- id: flows
type: io.kestra.plugin.git.SyncFlows
targetNamespace: "{{ taskrun.value }}"
gitDirectory: "{{'flows/' ~ taskrun.value}}"
includeChildNamespaces: false
- id: scripts
type: io.kestra.plugin.git.SyncNamespaceFiles
namespace: "{{ taskrun.value }}"
gitDirectory: "{{'scripts/' ~ taskrun.value}}"
pluginDefaults:
- type: io.kestra.plugin.git
values:
username: anna-geller
url: https://github.com/anna-geller/product
password: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
branch: main
dryRun: false
triggers:
- id: every_full_hour
type: io.kestra.plugin.core.trigger.Schedule
cron: "0 * * * *"
Properties
branch string
mainBranch to sync
Defaults to main.
cloneSubmodules booleanstring
Clone submodules
Default false; enable to fetch and initialize nested submodules.
connectTimeout integerstring
10000HTTP connect timeout (ms)
Default 10000 ms.
delete booleanstring
falseDelete files missing in Git
Default false. When true, removes Namespace Files absent from Git.
dryRun booleanstring
falseDry run only
When true, writes a diff without applying changes to Kestra.
failOnMissingDirectory booleanstring
trueFail if git directory missing
Default true. If false, skips when the rendered gitDirectory path does not exist.
gitConfig object
Git configuration overrides
Map of git config keys and values applied after clone, e.g.:
- core.fileMode: false (ignore permission flips)
- core.autocrlf: false (preserve line endings)
gitDirectory string
_filesGit directory for Namespace Files
Relative path containing files; defaults to _files.
namespace string
{{ flow.namespace }}Target namespace
Namespace receiving the files; defaults to the current flow namespace.
noProxy booleanstring
Disable proxy for HTTP
When true, forces direct connections instead of using the JVM proxy settings.
passphrase string
Passphrase for privateKey
password string
Password or personal access token
Supplies HTTP credentials. When a PAT is used, pushes are recorded under that PAT’s user without needing authorName and authorEmail.
**GitHub PAT permissions required: **
- Fine-grained PAT:
Contents: Read(clone/fetch) orContents: Read and Write(push), plusMetadata: Read(mandatory base permission). AddWorkflows: Read and Writewhen pushing.github/workflows/files. - Classic PAT:
reposcope covers all read/write operations; addworkflowwhen pushing workflow files.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
privateKey string
PEM private key
PEM-formatted private key matching a public key registered on the Git server. Generate with ssh-keygen -t ecdsa -b 256 -m PEM.
readTimeout integerstring
60000HTTP read timeout (ms)
Default 60000 ms.
trustedCaPemPath string
Extra trusted CA PEM path
Optional PEM-encoded CA bundle added to the JVM truststore; equivalent to git config http.sslCAInfo <path> for self-signed or internal CAs.
url string
Repository URL
HTTP(S) or SSH URI used for clone and push operations.
username string
Username or organization
Used for HTTP basic authentication and as a fallback commit author.