Last active
June 12, 2021 06:35
-
-
Save apc-kamezaki/77f63532c18e2601a36de55fc92c81d4 to your computer and use it in GitHub Desktop.
Run bicep lint on github actions
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
{ | |
"analyzers": { | |
"core": { | |
"verbose": false, | |
"enabled": true, | |
"rules": { | |
"no-hardcoded-env-urls": { | |
"level": "error", | |
"disallowedhosts": [ | |
"management.core.windows.net", | |
"gallery.azure.com", | |
"management.core.windows.net", | |
"management.azure.com", | |
"database.windows.net", | |
"core.windows.net", | |
"login.microsoftonline.com", | |
"graph.windows.net", | |
"trafficmanager.net", | |
"vault.azure.net", | |
"datalake.azure.net", | |
"azuredatalakestore.net", | |
"azuredatalakeanalytics.net", | |
"vault.azure.net", | |
"api.loganalytics.io", | |
"api.loganalytics.iov1", | |
"asazure.windows.net", | |
"region.asazure.windows.net", | |
"api.loganalytics.iov1", | |
"api.loganalytics.io", | |
"asazure.windows.net", | |
"region.asazure.windows.net", | |
"batch.core.windows.net" | |
] | |
}, | |
"no-unused-params": { | |
"level": "error" | |
}, | |
"no-unused-vars": { | |
"level": "error" | |
}, | |
"prefer-interpolation": { | |
"level": "error" | |
}, | |
"secure-parameter-default": { | |
"level": "error" | |
}, | |
"simplify-interpolation": { | |
"level": "error" | |
} | |
} | |
} | |
} | |
} |
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: Check on pull-request | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
lint: | |
name: Lint check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Chckout pull request | |
uses: actions/checkout@v2 | |
- name: Copy bicep linter configuration for CI | |
shell: bash | |
run: | | |
cp bicepconfig-ci.json bicepconfig.json | |
- name: Setup Bicep | |
uses: anthony-c-martin/setup-bicep@v0.1 | |
with: | |
version: v0.4.63 | |
- name: Run Bicep build | |
shell: bash | |
run: | | |
shopt -s globstar | |
exitCode=0 | |
for file in `ls **/*.bicep`; do | |
bicep build $file --stdout > /dev/null | |
echo "$file checked" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment