deployment-what-if-action/action.yml

45 строки
1.3 KiB
YAML

name: deployment-what-if
description: Preview Azure infrastructure changes before its deployment
inputs:
subscription:
description: Subscription ID
required: true
resourceGroup:
description: Resource group name
required: true
templateFile:
description: ARM template or Bicep file
required: true
parametersFile:
description: Parameters file for the ARM template or Bicep
required: false
additionalParameters:
description: Additional parameters to be applied on the ARM template or Bicep. Multiple parameters should be separated by spaces.
required: false
runs:
using: composite
steps:
- run: |
PARAMETERS=""
if [[ ! -z "${{ inputs.parametersFile }}" || ! -z "${{ inputs.additionalParameters }}" ]]; then
PARAMETERS="--parameters"
if [[ ! -z "${{ inputs.parametersFile }}" ]]; then
PARAMETERS="$PARAMETERS @${{ inputs.parametersFile }}"
fi
if [[ ! -z "${{ inputs.additionalParameters }}" ]]; then
PARAMETERS="$PARAMETERS ${{ inputs.additionalParameters }}"
fi
fi
az deployment group what-if \
--resource-group ${{ inputs.resourceGroup }} \
--subscription ${{ inputs.subscription }} \
--template-file ${{ inputs.templateFile }} \
$PARAMETERS
shell: bash