PushExecutionFiles​Push​Execution​Files

Commit and push execution output files to a Git repository.

This task pushes one or more files produced by a task execution directly to Git.

yaml
type: "io.kestra.plugin.git.PushExecutionFiles"

Push output files generated from task to Git

yaml
id: push_exec_files
namespace: company.team

tasks:
  - id: generate
    type: io.kestra.plugin.scripts.python.Script
    taskRunner:
      type: io.kestra.plugin.core.runner.Process
    outputFiles:
      - report.txt
    script: |
      with open("report.txt", "w") as f:
          f.write("Analysis done")

  - id: push
    type: io.kestra.plugin.git.PushExecutionFiles
    files:
      - "*.txt"
    gitDirectory: analytics
    url: https://github.com/company/data-pipeline
    username: git_user
    password: "{{ secret('GITHUB_TOKEN') }}"
    branch: data-reports
    commitMessage: "Add CSV and JSON reports {{ now() }}"

Push and rename execution outputs using filesMap

yaml
id: push_with_map
namespace: company.logs

tasks:
  - id: generate
    type: io.kestra.plugin.scripts.shell.Script
    outputFiles:
      - "run.log"
    script: |
      echo "Run completed at $(date)" > run.log

  - id: push
    type: io.kestra.plugin.git.PushExecutionFiles
    filesMap:
      "run-{{ execution.id }}.log": "{{ outputs.generate.outputFiles['run.log'] }}"
    gitDirectory: logs
    url: https://github.com/company/log-archive
    username: git_user
    password: "{{ secret('GITHUB_TOKEN') }}"
    branch: logs
    commitMessage: "Archive log for run {{ execution.id }}"
Properties

The commit author email

If null, no author will be set on this commit.

Default `username`

The commit author name

If null, the username will be used instead.

Default main

The branch to which files should be committed and pushed

If the branch doesn’t exist yet, it will be created.

Whether to clone submodules

Default Add files from execution {{ execution.id }}

Git commit message

Default true

Whether to delete flows/files from Git that are no longer present in Kestra

If true (default), files present in Git but not in Kestra will be deleted from the Git repository.

Default false

If true, the task will only output modifications without pushing any file to Git yet. If false (default), all listed files will be pushed to Git immediately.

Default false

Glob pattern(s) to select execution output files from the working directory

If provided, will match files relative to the execution working directory.

A map of key-value pairs where the key is the filename and the value is the URI of the file to upload.

This should be a map of URIs, with the key being the filename that will be upload and the value is the URI.This property is intended to be used with the output files of other tasks. Many Kestra tasks, incl. all Downloads tasks, output a map of files so that you can directly pass the output property to this task e.g., outputFiles in the S3 Downloads task or the files in the Archive Decompress task.

Git configuration to apply to the repository

Map of Git config keys and values, applied after clone few examples: - 'core.fileMode': false -> ignore file permission changes - 'core.autocrlf': false -> prevent line ending conversion

Default _outputs

Directory in the Git repository where files should be pushed

Defaults to _outputs.

The passphrase for the privateKey

The password or Personal Access Token (PAT) – when you authenticate the task with a PAT, any flows or files pushed to Git from Kestra will be pushed from the user associated with that PAT. This way, you don't need to configure the commit author (the authorName and authorEmail properties).

PEM-format private key content that is paired with a public key registered on Git

To generate an ECDSA PEM format key from OpenSSH, use the following command: ssh-keygen -t ecdsa -b 256 -m PEM. You can then set this property with your private key content and put your public key on Git.

Optional path to a PEM-encoded CA certificate to trust (in addition to the JVM default truststore)

Equivalent to git config http.sslCAInfo <path>. Use this for self-signed/internal CAs.

The URI to clone from

The username or organization