Validate Bicep templates #673
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate Bicep templates | |
on: | |
pull_request: | |
branches: [ main ] | |
paths: | |
- 'templates/**' | |
push: | |
branches: [ main ] | |
paths: | |
- 'templates/**' | |
schedule: | |
# ┌───────────── minute (0 - 59) | |
# │ ┌───────────── hour (0 - 23) | |
# │ │ ┌───────────── day of the month (1 - 31) | |
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | |
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# * * * * * | |
- cron: '30 1 * * *' | |
workflow_dispatch: | |
jobs: | |
validate_arm_templates: | |
name: Build Bicep and Validate ARM Templates | |
runs-on: ubuntu-latest | |
steps: | |
- name: Apply arm-templates label on PR | |
uses: actions/github-script@v6 | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
script: | | |
github.rest.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: ['arm-templates'] | |
}) | |
- uses: actions/[email protected] | |
with: | |
submodules: recursive | |
- name: Generate ARM file | |
working-directory: templates/azure | |
run: az bicep build --file azuredeploy.bicep --outfile azuredeploy.json | |
- name: Checkout Azure/arm-ttk | |
uses: actions/[email protected] | |
with: | |
repository: Azure/arm-ttk | |
path: arm-ttk | |
- name: Run arm-ttk | |
shell: pwsh | |
run: | | |
Import-Module ./arm-ttk/arm-ttk/arm-ttk.psd1 | |
Test-AzTemplate -TemplatePath ./templates/azure/azuredeploy.json -Skip 'Template Should Not Contain Blanks','URIs Should Be Properly Constructed' |