
Git PushFlows
CertifiedPush flows to Git
Git PushFlows
Push flows to Git
Exports saved flows from sourceNamespace (optionally child namespaces) into gitDirectory (default _flows) and pushes to Git. Can rewrite namespaces to targetNamespace; branch is created if missing and dry-run writes only the diff.
type: io.kestra.plugin.git.PushFlowsExamples
Automatically push all saved flows from the dev namespace and all child namespaces to a Git repository every day at 5 p.m. Before pushing to Git, the task will adjust the flow's source code to match the targetNamespace to prepare the Git branch for merging to the production namespace. Note that the automatic conversion of sourceNamespace to targetNamespace is optional and should only be considered as a helper for facilitating the Git workflow for simple use cases — only the namespace property within the flow will be adjusted and if you specify namespace names within e.g. Flow triggers, those may need to be manually adjusted. We recommend using separate Kestra instances for development and production with the same namespace names across instances.
id: push_to_git
namespace: company.ops
tasks:
- id: commit_and_push
type: io.kestra.plugin.git.PushFlows
sourceNamespace: dev
targetNamespace: prod
flows: "*"
includeChildNamespaces: true
gitDirectory: _flows
url: https://github.com/kestra-io/scripts
username: git_username
password: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
branch: main
commitMessage: "add flows {{ now() }}"
dryRun: true
triggers:
- id: schedule_push
type: io.kestra.plugin.core.trigger.Schedule
cron: "0 17 * * *"
Release all flows and scripts from selected namespaces to a Git repository every Thursday at 11: 00 AM. Adjust the values list to include the namespaces for which you want to push your code to Git. This System Flow will create two commits per namespace: one for the flows and one for the scripts.
id: git_push
namespace: company.ops
tasks:
- id: push
type: io.kestra.plugin.core.flow.ForEach
values: ["company", "company.team", "company.analytics"]
tasks:
- id: flows
type: io.kestra.plugin.git.PushFlows
sourceNamespace: "{{ taskrun.value }}"
gitDirectory: "{{'flows/' ~ taskrun.value}}"
includeChildNamespaces: false
- id: scripts
type: io.kestra.plugin.git.PushNamespaceFiles
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: schedule_push_to_git
type: io.kestra.plugin.core.trigger.Schedule
cron: "0 11 * * 4"
Properties
branch string
mainBranch to push flows
Defaults to main; created if absent.
cloneSubmodules booleanstring
Clone submodules
Default false; enable to fetch and initialize nested submodules.
commitMessage string
Add flows from `sourceNamespace`Git commit message
connectTimeout integerstring
10000HTTP connect timeout (ms)
Default 10000 ms.
delete booleanstring
trueDelete removed resources
If true (default), removes Git files that no longer exist in Kestra.
dryRun booleanstring
falseDry run only
When true, writes a diff file without pushing. Default false pushes immediately.
flows stringarray
**Flows to include
Glob pattern(s) against flow IDs; defaults to all (**).
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
_flowsFlow destination directory
Relative path inside the repo; defaults to _flows. Child namespaces are nested under this path when includeChildNamespaces is true.
includeChildNamespaces booleanstring
falseInclude child namespaces
When true, exports flows from child namespaces into nested directories under gitDirectory.
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.
sourceNamespace string
{{ flow.namespace }}Source namespace
Namespace to export flows from; defaults to the current flow namespace.
targetNamespace string
Target namespace override
If set, rewrites the namespace field in exported flows to this value.
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.