Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/validate-azd-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Validate AZD Template

on:
push:
branches: [ main ]
paths:
- 'azure.yaml'
- 'infra/**'
- '.github/workflows/validate-azd-template.yml'
pull_request:
branches: [ main ]
paths:
- 'azure.yaml'
- 'infra/**'
- '.github/workflows/validate-azd-template.yml'
schedule:
# Run every Sunday at 9 PM UTC (Sunday night)
- cron: '0 21 * * 0'
workflow_dispatch:

permissions:
contents: read
security-events: write
actions: read

jobs:
validate:
name: Validate Bicep Template
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Azure CLI
run: |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

- name: Install Bicep
run: |
az bicep install

- name: Configure Bicep
run: |
az config set bicep.use_binary_from_path=false
az bicep version

- name: Validate Bicep template
run: |
echo "Validating Bicep template..."
az bicep build -f infra/main.bicep --stdout
echo "Bicep template validation completed successfully!"

- name: Run Microsoft Security DevOps Analysis
uses: microsoft/security-devops-action@v1
id: msdo
with:
categories: 'IaC'
tools: 'templateanalyzer'

- name: Upload results to Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.msdo.outputs.sarifFile }}
Loading