Built-in Tasks
About 499 wordsAbout 2 min
What Are Built-in Tasks
A pipeline consists of multiple jobs(Open in new window). When a job needs to perform a common CI/CD action — such as adding reviewers to a pull request, closing an issue, or reporting unit test coverage — you do not have to write your own script or look for a plugin image. Built-in tasks are provided directly by Cloud Native Build: just declare the task type and its parameters in .cnb.yml.
What built-in tasks solve:
- No scripts to write: common CI/CD actions work out of the box, with no shell script or plugin image to maintain
- No credentials to configure: operations are performed inside the platform, so there is no token to request or pass around
- Results can be passed on: task results can be exported as environment variables via
exportsfor use in subsequent jobs
Usage
A built-in task is specified via the Stage's type field in the format <category>:<task> (such as git:reviewer, docker:cache). Parameters are passed through options, and task results can be exported as environment variables via exports for use in subsequent jobs.
main:
pull_request:
- stages:
- name: add a random reviewer
type: git:reviewer
options:
type: add-reviewer-from-repo-members
exports:
reviewersForAt: REVIEWERS_FOR_AT
- name: notify reviewer
script: 'echo "please review: $REVIEWERS_FOR_AT"'In the example above, type selects the task, options passes parameters, and exports exposes the result.
Task List
All built-in tasks are listed below by category. Click a task to view its detailed reference.
Docker
- docker:cache: Build Docker image cache to speed up dependency installation
cnb
- cnb:await-resolve: Wait/notify mechanism for collaboration across multiple pipelines
- cnb:apply: Trigger other pipelines within the current repository
- cnb:trigger: Trigger a pipeline in a specified repository
- cnb:read-file: Export file content as environment variables
- cnb:destroy-token: Destroy the pipeline CNB_TOKEN
vscode
- vscode:go: Control the availability of Workspaces environments
git
- git:reviewer: Automatically add reviewers to pull requests
- git:auto-merge: Automatically merge pull requests
- git:issue-update: Update issue status
- git:release: Release repository
- git:pr-commit-message-preset: Set pre-defined commit message for PR
- git:pr-update: Updating the title and labels of the pull request
testing
- testing:coverage: Report unit test coverage
artifact
- artifact:remove-tag: Remove CNB artifact tags
tapd
- tapd:status-update: Update the status of TAPD-associated items (story, task, or bug)
- tapd:comment: Submit TAPD associated item (story, task, or bug) comments
knowledge
- knowledge:update: Build repository docs, issues, etc. into the knowledge base
npc
- npc:go: Execute NPC tasks