I’m using trigger-workflows-for-all-modified in the Swissknife Orb so that I can conditionally deploy builds in my monorepo.
The orb activates correctly and tries to trigger deploys when relevant directories have been changed. But it’s not able to execute the required workflow.
Here is the workflow in my config.yaml
:
trigger-needed-workflows:
docker:
- image: "circleci/node:12"
working_directory: /home/circleci/project/
steps:
- checkout
- swissknife/trigger-workflows-for-all-modified:
base-branch: master
vcs-type: bitbucket
run-mode-for-base-branch: run_for_last_commit
use-divergence-point: true
code-param-name-map: '
[
{"regex": "^(app).*", "param_name": "run_app_workflow"},
{"regex": "^(api).*", "param_name": "run_api_workflow"},
{"regex": "^(public).*", "param_name": "run_public_workflow"},
{"regex": "^(admin).*", "param_name": "run_admin_workflow"}
]'
additional-param-map: '{"run_trigger_workflow": false}'
use-swissknife-sha: true
Additionally I set the following environment variables:
-
CIRCLE_TOKEN
: An API token I created for the project -
CIRCLE_PROJECT_USERNAME
: Using same as:app.circleci.com/pipelines/bitbucket/[username]
-
$CIRCLE_PROJECT_REPONAME
: Using same as:app.circleci.com/pipelines/bitbucket/[username]/[reponame]
The output in circleci says that it’s trying to execute the following API call:
curl --silent -X POST \
"https://circleci.com/api/v2/project/bitbucket/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline?circle-token=${CIRCLE_TOKEN}" \
-H 'Accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"branch": "'$CIRCLE_BRANCH'",
"parameters": '$custom_params'
}'
And here is the error message:
Calling Circle CI for branch: master with params
{"run_trigger_workflow":false,"swissknife_sha":"[SHA]","run_api_workflow":true}
{
"message" : "Project not found"
}
Is there any way to work out why it’s not able to find the project?
Is it possible the environment variables aren’t being passed through?
Any help would be appreciated.