Delete non-protected branches in the current repository within the pipeline.
The name(s) of the branch(es) to be deleted. Multiple branches should be separated by , or ;.
CNB_TOKENThe token required to access the CNB OpenAPI, with repo-code:rw permissions.
By default, it is fetched from the environment variable CNB_TOKEN.
The names of the successfully deleted branches, separated by ,.
main:
push:
- stages:
- name: delete branch
image: cnbcool/delete-branch
settings:
branch: test1,test2,test3,test4
exports:
deleted_branches: DELETED_BRANCHES
- name: show deleted branch
script: echo $DELETED_BRANCHES
main:
pull_request.merged:
- stages:
- name: delete branch
image: cnbcool/delete-branch
settings:
branch: $CNB_PULL_REQUEST_BRANCH
exports:
deleted_branches: DELETED_BRANCHES
- name: show deleted branch
script: echo $DELETED_BRANCHES