Skip to content

Commit 116d61b

Browse files
author
Gordon Byers
authored
Merge pull request #110 from Azure/gb-betterbicepbuild
Stopping bicep build in main branch post merge
2 parents 5b90b9b + d6bcfe5 commit 116d61b

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

.github/workflows/bicepBuild.yml

+22-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ on:
77
paths:
88
- 'bicep/*'
99
- ".github/workflows/bicepBuild.yml"
10+
branches-ignore: main
11+
12+
pull_request:
13+
branches: main
1014

1115
workflow_dispatch:
1216

1317
jobs:
14-
build:
18+
Validation:
1519
runs-on: ubuntu-latest
1620

1721
steps:
@@ -42,13 +46,27 @@ jobs:
4246
4347
/home/runner/.azure/bin/bicep build bicep/main.bicep --outdir $compiledir
4448
45-
- name: ContextCheck
49+
- name: Git diff
4650
shell: pwsh
51+
id: isGitDiff
4752
run: |
48-
cd bicep/compiled
49-
dir
53+
$diff=git diff --shortstat
54+
55+
if ($null -eq $diff) {
56+
write-output "No difference in compiled bicep to commit"
57+
echo "::set-output name=GITDIFF::false" #outputting for condition
58+
}
59+
else {
60+
write-output "There are differences in compiled bicep to commit"
61+
echo "::set-output name=GITDIFF::true" #outputting for condition
62+
}
63+
64+
- name: Debug
65+
run: |
66+
echo "gitdiff is ${{ steps.isGitDiff.outputs.GITDIFF}}"
5067
5168
- name: GIT Push Json file
69+
if: steps.isGitDiff.outputs.GITDIFF==true
5270
uses: actions-x/commit@v2
5371
with:
5472
message: Adding auto compiled bicep json

bicep/compiled/main.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.4.1008.15138",
8-
"templateHash": "5512021043181041758"
8+
"templateHash": "15343024568483163339"
99
}
1010
},
1111
"parameters": {
@@ -2202,6 +2202,10 @@
22022202
"type": "string",
22032203
"value": "[if(parameters('createKV'), variables('akvName'), '')]"
22042204
},
2205+
"keyVaultId": {
2206+
"type": "string",
2207+
"value": "[if(parameters('createKV'), resourceId('Microsoft.KeyVault/vaults', variables('akvName')), '')]"
2208+
},
22052209
"containerRegistryName": {
22062210
"type": "string",
22072211
"value": "[if(not(empty(parameters('registries_sku'))), variables('acrName'), '')]"

0 commit comments

Comments
 (0)