Git PushNamespaceFiles

Git PushNamespaceFiles

Certified

Push Namespace Files to Git

Exports Namespace Files from a Kestra namespace (optionally child namespaces) into gitDirectory (default _files) and pushes to Git. Branch is created if missing; use files globs to narrow the selection and dryRun to emit a diff only. Push sequentially to avoid merge conflicts.

yaml
type: io.kestra.plugin.git.PushNamespaceFiles

Push all saved Namespace Files from the dev namespace to a Git repository every 15 minutes.

yaml
id: push_to_git
namespace: company.ops

tasks:
  - id: commit_and_push
    type: io.kestra.plugin.git.PushNamespaceFiles
    namespace: dev
    files: "**"
    gitDirectory: _files
    url: https://github.com/kestra-io/scripts
    username: git_username
    password: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
    branch: dev
    commitMessage: "add namespace files"
    dryRun: true
triggers:
  - id: schedule_push_to_git
    type: io.kestra.plugin.core.trigger.Schedule
    cron: "*/15 * * * *"

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.

yaml
id: git_push
namespace: company.ops

tasks:
  - id: push
    type: io.kestra.plugin.core.flow.Loop
    values: ["company", "company.team", "company.analytics"]
    tasks:
      - id: flows
        type: io.kestra.plugin.git.PushFlows
        sourceNamespace: "{{ item.value }}"
        gitDirectory: "{{'flows/' ~ item.value}}"
        includeChildNamespaces: false
        username: anna-geller
        url: https://github.com/anna-geller/product
        password: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
        branch: main
        dryRun: false

      - id: scripts
        type: io.kestra.plugin.git.PushNamespaceFiles
        namespace: "{{ item.value }}"
        gitDirectory: "{{'scripts/' ~ item.value}}"
        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

Kestra API authentication

Definitions
apiTokenstring

API token for authentication.

autobooleanstring
Defaulttrue

Automatically retrieve the URL and the credentials from Kestra's configuration if available

Can be configured globally in the Kestra configuration file:

  • Set kestra.tasks.sdk.authentication.url for the API URL
  • Set kestra.tasks.sdk.authentication.api-token for API token auth
  • Set kestra.tasks.sdk.authentication.username and kestra.tasks.sdk.authentication.password for HTTP Basic auth The Enterprise Edition also allows an administrator to set these defaults at the namespace or the tenant level. Set this to false without any credentials to call a Kestra API that requires no authentication.
passwordstring

Password for HTTP Basic authentication.

usernamestring

Username for HTTP Basic authentication.

Commit author email

If null, no author is set.

Commit author name

Defaults to username when empty.

Defaultmain

Branch to push Namespace Files

Defaults to main; created if absent.

Clone submodules

Default false; enable to fetch and initialize nested submodules.

DefaultAdd files from `namespace` namespace

Git commit message

Default10000

HTTP connect timeout (ms)

Default 10000 ms.

Defaulttrue

Delete removed resources

If true (default), removes Git files that no longer exist in Kestra.

Defaultfalse

Dry run only

When true, writes a diff file without pushing. Default false pushes immediately.

Defaultfalse

Fail when no files are matched

If true, throws when the glob finds no files; otherwise logs and skips.

Default**

Namespace Files to include

Glob pattern(s); defaults to all (**). Matches paths relative to the namespace root.

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)
Default_files

Destination directory

Relative path inside the repo; defaults to _files. Paths under the namespace are preserved beneath this directory.

Defaultfalse

Include child namespaces

Default false. When true, also pushes files from descendant namespaces, each under a directory named by its full dotted namespace inside gitDirectory.

Kestra API URL

URL of the Kestra server API. If not set, the URL of the default SDK authentication is used, set with the kestra.tasks.sdk.authentication.url configuration property, or at the namespace or the tenant level on the Enterprise Edition. It then falls back to the kestra.url configuration property, and finally to http://localhost: 8080.

Known hosts file content used for SSH host key verification

OpenSSH known_hosts-formatted content used to verify the remote server's SSH host key. If not set, the system/user known_hosts file is used. Only relevant when strictHostKeyChecking is true.

Default{{ flow.namespace }}

Source namespace

Namespace whose files are exported; defaults to the current flow namespace.

Disable proxy for HTTP

When true, forces direct connections instead of using the JVM proxy settings.

Passphrase for privateKey

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) or Contents: Read and Write (push), plus Metadata: Read (mandatory base permission). Add Workflows: Read and Write when pushing .github/workflows/ files.
  • Classic PAT: repo scope covers all read/write operations; add workflow when pushing workflow files.

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.

DefaultSYNC
Possible Values
SYNCDELETE_ONLY

Push mode

SYNC (default) writes every matched resource to the work tree and stages it, in addition to staging removals when delete is true — this is the standard push behavior, unchanged.

DELETE_ONLY stages only the removal of resources no longer present on the instance: it leaves already-pushed, still-matching resources untouched even if they changed since the last push. Use it to push a deletion without re-pushing unrelated modified resources. DELETE_ONLY implies deletion staging, so setting delete to false together with DELETE_ONLY is ignored (a warning is logged).

Default60000

HTTP read timeout (ms)

Default 60000 ms.

Whether to verify the SSH remote server's host key

When enabled, the host key presented by the Git server is verified against knownHosts (if provided) or the system/user known_hosts file. Disabling it exposes the connection to man-in-the-middle attacks (CWE-297). Set knownHosts alongside this property for a hardened setup. The default differs by edition: disabled (false) on Kestra OSS, enabled (true) on Kestra Enterprise Edition.

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.

Repository URL

HTTP(S) or SSH URI used for clone and push operations.

Username or organization

Used for HTTP basic authentication and as a fallback commit author.