Job only: [triggers] not work if triggered by $CI_JOB_TOKEN
Problem to solve
Execute jobs triggered with a $CI_JOB_TOKEN
or pipeline trigger.
Further details
Actually, jobs with only: [triggers]
are only executed when the token is a pipeline triggger.
deploy-artifact-to-repo:
stage: deploy
dependencies: []
only:
- triggers
curl -X POST -F token=MY_PIPELINE_TRIGGER -F ref=XXX https://XXX/api/v4/projects/$CI_PROJECT_ID/trigger/pipeline
Proposal
Execute this jobs if the token is $CI_JOB_TOKEN
or a pipeline trigger
curl -X POST -F token=$CI_JOB_TOKEN -F ref=XXX https://XXX/api/v4/projects/$CI_PROJECT_ID/trigger/pipeline
/label ~feature
Edited by JF