-
Notifications
You must be signed in to change notification settings - Fork 141
44 lines (43 loc) · 1.13 KB
/
validate-build-bicep.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
---
name: validate-build-bicep
on:
pull_request:
branches: [main]
paths:
- 'src/bicep/**'
- '!src/bicep/**.md'
env:
BICEP_VERSION: ''
jobs:
validate-build:
runs-on: ubuntu-latest
permissions:
actions: read
checks: read
contents: write
deployments: write
issues: read
discussions: read
packages: none
pages: read
pull-requests: write
repository-projects: read
security-events: write
statuses: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- run: |
git config user.name github-actions
git config user.email [email protected]
az bicep install
az bicep version
az bicep build --file src/bicep/mlz.bicep --outfile src/bicep/mlz.json
if [[ $(git status --porcelain) ]]; then
git add src/bicep/mlz.json
git commit -m "GitHub Action: Build Bicep to JSON"
git push origin HEAD:"$GITHUB_HEAD_REF"
fi