logo
0
0
Login

Delete Branch

Delete non-protected branches in the current repository within the pipeline.

Parameters

branch

  • Type: String
  • Required: Yes

The name(s) of the branch(es) to be deleted. Multiple branches should be separated by , or ;.

token

  • Type: String
  • Required: No
  • Default: CNB_TOKEN

The token required to access the CNB OpenAPI, with repo-code:rw permissions.
By default, it is fetched from the environment variable CNB_TOKEN.

Output

deleted_branches

The names of the successfully deleted branches, separated by ,.

Usage on Cloud Native Build

Delete Specified Branches

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

Delete Source Branch After Merge

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

About

删除分支的插件

244.00 KiB
0 forks0 stars2 branches0 TagREADMEMIT license
Language
Markdown53.8%
JavaScript32.9%
License8.9%
Dockerfile4%
Others0.4%