We are using CircleCI for our open source project. We have only one workflow is our circleci configuration for build and executing test cases. We wanted to have an approval based trigger for CircleCI but it is available only for configs with multiple workflows. Like this
workflows: version: 2 build-test-and-approval-deploy: jobs: - build # your custom job from your config, that builds your code - test1: # your custom job; runs test suite 1 requires: # test1 will not run until the `build` job is completed. - build - test2: # another custom job; runs test suite 2, requires: # test2 is dependent on the succes of job `test1` - test1 - hold: # <<< A job that will require manual approval in the CircleCI web application. type: approval # <<< This key-value pair will set your workflow to a status of "On Hold" requires: # We only run the "hold" job when test2 has succeeded - test2 # On approval of the `hold` job, any successive job that requires the `hold` job will run. # In this case, a user is manually triggering the deploy job. - deploy: requires: - hold
Since I have only one workflow like this
- image: circleci/node:12
- run: npm install
How can I have an approval based trigger only if I have one workflow?