Git Push (Public Buddy key)

  • 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.
push_urlrequired string
The URL to the repository.
git_auth_moderequired string
The authentication mode for SSH. Should be set to PUBLIC_BUDDY_KEY.
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 the .gitignore file.
isolatedoptional boolean
When set to true, the 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 https://app.buddy.works/buddy/repo",
  "type": "PUSH",
  "trigger_time": "ON_EVERY_EXECUTION",
  "deployment_excludes": [
    "/tmp/"
  ],
  "push_url": "buddy@app.buddy.works:buddy/repo",
  "comment": "$BUDDY_EXECUTION_ID",
  "tag": "tagName",
  "target_branch": "$BUDDY_EXECUTION_BRANCH",
  "git_auth_mode": "PUBLIC_BUDDY_KEY",
  "push_tags": false,
  "use_custom_gitignore": true,
  "custom_options": "--no-verify",
  "without_force": false
}'
EXAMPLE RESPONSE
{ "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2/actions/2", "html_url": "https://app.buddy.works/buddy/company-website/pipelines/action/2/edit", "id": 2, "name": "Push to https://app.buddy.works/buddy/repo", "type": "PUSH", "trigger_time": "ON_EVERY_EXECUTION", "push_tags": false, "git_auth_mode": "PUBLIC_BUDDY_KEY", "deployment_excludes": [ "/tmp/" ], "push_url": "buddy@app.buddy.works:buddy/repo", "comment": "$BUDDY_EXECUTION_ID", "tag": "tagName", "target_branch": "$BUDDY_EXECUTION_BRANCH", "use_custom_gitignore": true, "custom_options": "--no-verify", "without_force": false, "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