I’ve created a YAML template to extends from with a fixed stage “Deploy” (can not be modified by users, only pass params) and an optional stage “PreDeploy” that should be entirely provided by template users (if they want to add this stage).
parameters:
- name: application
type: string
default: ""
- name: PreDeployStage
type: stage
default: {}
stages:
- ${{ parameters.PreDeployStage }}
- stage: 'Deploy'
There is a variable group called “Secrets” that should never be used in a stage other than “Deploy”. In order to prevent template users to provide a stage which uses this variable group (either at stage level or job level) I was wondering if something like this can be used (idea would be to delete all references to “Secrets” variable group in the provided stage).
Is this possible?