|
1 | | -name: Azure Template Validation |
2 | | -on: |
3 | | - push: |
4 | | - branches: |
5 | | - - main |
6 | | - - dev |
7 | | - workflow_dispatch: |
8 | | - |
9 | | -permissions: |
10 | | - contents: read |
11 | | - id-token: write |
12 | | - pull-requests: write |
13 | | - |
14 | | -jobs: |
15 | | - template_validation_job: |
| 1 | +name: Azure Template Validation |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + id-token: write |
| 10 | + pull-requests: write |
| 11 | +jobs: |
| 12 | + template_validation_job: |
| 13 | + runs-on: ubuntu-latest |
16 | 14 | environment: production |
17 | | - runs-on: ubuntu-latest |
18 | | - name: Template validation |
19 | | - |
20 | | - steps: |
21 | | - # Step 1: Checkout the code from your repository |
22 | | - - name: Checkout code |
23 | | - uses: actions/checkout@v4 |
24 | | - |
25 | | - # Step 2: Validate the Azure template using microsoft/template-validation-action |
26 | | - - name: Validate Azure Template |
27 | | - |
28 | | - id: validation |
| 15 | + name: Template validation |
| 16 | + steps: |
| 17 | + # Step 1: Checkout the code from your repository |
| 18 | + - name: Checkout code |
| 19 | + uses: actions/checkout@v4 |
| 20 | + # Step 2: Validate the Azure template using microsoft/template-validation-action |
| 21 | + - name: Validate Azure Template |
| 22 | + uses: microsoft/template-validation-action@Latest |
| 23 | + id: validation |
29 | 24 | with: |
30 | | - useDevContainer: false |
31 | | - env: |
32 | | - AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} |
33 | | - AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} |
34 | | - AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
35 | | - AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }} |
36 | | - AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }} |
37 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
38 | | - |
39 | | - # Step 3: Print the result of the validation |
40 | | - - name: Print result |
41 | | - run: cat ${{ steps.validation.outputs.resultFile }} |
| 25 | + useDevContainer: false |
| 26 | + env: |
| 27 | + AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} |
| 28 | + AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} |
| 29 | + AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} |
| 30 | + AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
| 31 | + AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }} |
| 32 | + AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }} |
| 33 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 34 | + # Step 3: Print the result of the validation |
| 35 | + - name: Print result |
| 36 | + run: cat ${{ steps.validation.outputs.resultFile }} |
0 commit comments