I’m trying to define a reusable workflow template for my organisation. The job within this template references a project variable (e.g. EXAMPLE_API_KEY
) which looks roughly like below:
customjob:
image:
name: $[[ inputs.image ]]:$[[ inputs.version ]]
entrypoint: [""]
script:
- mycmd login
variables:
EXAMPLE_API_KEY: $EXAMPLE_API_KEY
The EXAMPLE_API_KEY
is a project level variable which is not flagged to be protected or expanded, and I have ticked it to be masked (it meets the regular expression requirements, and I’ve also tested without masking).
From my app repo I then want to call my reusable workflow that is located in some template repo, for example:
include:
- project: kash/cicd-workflows
ref: main
file: workflow.yml
When this runs it appears that the EXAMPLE_API_KEY
is unset. Is it possible to only reference it in the customjob
like I’ve done above, or would I need to essentially define workflow inputs and pass it from the app repo downwards?