Merge pull request #29 from Azure-Samples/marlenezw-patch-1 #14
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: Bicep scripts | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- master | |
pull_request: | |
branches: | |
- main | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout PR | |
if: ${{ github.event_name == 'pull_request'}} | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Checkout branch | |
if: ${{ github.event_name == 'push'}} | |
uses: actions/checkout@v2 | |
- name: Build Bicep | |
uses: azure/CLI@v1 | |
with: | |
inlineScript: az bicep build -f infra/main.bicep | |
- name: Format Bicep | |
uses: azure/CLI@v1 | |
with: | |
inlineScript: az bicep format -f infra/main.bicep | |
- name: Add updated Bicep files to commit | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: 'Update Bicep files' | |
add: '*.bicep' |