Git Push (Private key from environment variables)

  • POST
  • /workspaces
  • /:domain
  • /projects
  • /:project_name
  • /pipelines
  • /:pipeline_id
  • /actions

Request

URL PARAMETERS
domainrequired string
The workspace domain.
pipeline_idrequired integer
The numerical ID of the desired pipeline.
project_namerequired string
The name ID of the project.
POST PARAMETERS
namerequired string
The name of the action.
typerequired string
The type of the action. Should be set to PUSH.
git_auth_moderequired string
The authentication mode for SSH. Should be set to ENV_KEY.
push_urlrequired string
The URL to the repository.
env_keyrequired string
The private SSH key name defined in environment variables.
tagoptional string
The name of the tag to push.
push_tagsoptional boolean
Defines whether the tags should be pushed to the remote repository or not.
use_custom_gitignoreoptional boolean
When set to false the push will ignore paths listed in .gitignore file.
isolatedoptional boolean
When set to true, action will push only repository files (without artifacts).
target_branchoptional string
Defines the remote branch to which the push will be performed. If empty, files will be pushed to the same branch.
deployment_excludesoptional string[]
The paths and/or files that will be left out during the push. Only works when use_custom_gitignore is set to true.
without_forceoptional boolean
Defines whether the --force flag should be used when invoking the git push command or not.
commentoptional string
Optional custom git commit message.
custom_optionsoptional string
Use custom git push options.

Last modified on Oct 7, 2024

Example:

curl -X POST "https://api.buddy.works/workspaces/:domain/projects/:project_name/pipelines/:pipeline_id/actions" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Push to Your Repo",
  "type": "PUSH",
  "trigger_time": "ON_EVERY_EXECUTION",
  "git_auth_mode": "ENV_KEY",
  "push_url": "https://app.buddy.works/buddy/repo",
  "push_tags": true,
  "target_branch": "stage",
  "tag": "tagName",
  "use_custom_gitignore": true,
  "without_force": true,
  "custom_options": "--no-verify",
  "comment": "Push from Buddy",
  "deployment_excludes": [
    "/tmp/",
    "*.log"
  ],
  "env_key": "my_key"
}'
EXAMPLE RESPONSE
{ "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2/actions/851", "html_url": "https://app.buddy.works/buddy/company-website/pipelines/action/851/edit", "id": 851, "name": "Push to Your Repo", "type": "PUSH", "trigger_time": "ON_EVERY_EXECUTION", "git_auth_mode": "ENV_KEY", "env_key": "my_key", "last_execution_status": "INITIAL", "push_url": "https://app.app.buddy.works/buddy/repo", "target_branch": "stage", "tag": "tagName", "push_tags": true, "use_custom_gitignore": true, "custom_options": "--no-verify", "without_force": true, "comment": "Push from Buddy", "deployment_excludes": [ "/tmp/", "*.log" ], "pipeline": { "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2", "html_url": "https://app.buddy.works/buddy/company-website/pipelines/pipeline/2", "id": 2, "name": "Live mirror", "on": "CLICK", "refs": [ "refs/heads/master" ], "last_execution_status": "SUCCESSFUL", "last_execution_revision": "506a3963507943d6908154f4bc9646e829128a08" } }
STATUS
201 Created
LIMITS
X-Rate-Limit-Limit: 1 X-Rate-Limit-Remaining: 999