CircleCI runs build for Draft PR.
This docker image supports cancel build if PR in the Drfat
status or has Draft
label.
version: 2
jobs:
cancel_draft_build:
parallelism: 1
docker:
- image: vitalinfo/circleci-cancel-draft
environment:
CIRCLECI_TOKEN: ZZZZZZZZZZZ
GITHUB_TOKEN: XXXXXXXXXXX
steps:
- run: cancel-draft-build
workflows:
version: 2
tests:
jobs:
- cancel_draft_build
- ... # other build steps
$ docker build . -t vitalinfo/circleci-cancel-draft && docker push vitalinfo/circleci-cancel-draft
- Open New personal access token (classic)
- Set Note
- Choose Expiration
- Select workflow scope
- Click Generate token
- Open Personal API Tokens
- Click Create New API Token
- Set Token Name
- Click Add API Token