-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
34 lines (31 loc) · 1.06 KB
/
action.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
name: "Bicep Colorize Pull Request"
description: "Create a pull request and colorize the Bicep 'what-if' using GitHub's built-in capabilities"
branding:
icon: "git-pull-request"
color: "red"
inputs:
location:
description: "Location of the deployment"
required: true
template-file:
description: "Bicep template file"
default: ./main.bicep
required: true
parameters-file:
description: "Bicep parameters file"
required: true
default: ./parameters.json
token:
description: "GITHUB_TOKEN secret to authenticate the workflow job"
required: true
runs:
using: "composite"
steps:
- name: "Generate what-if"
run: |
az deployment sub what-if --location ${{ inputs.location }} --template-file ${{ inputs.template-file }} --parameters ${{ inputs.parameters-file }} > results.md
sed -i -e '1s/^/```diff\n/' -e '$a```' -e 's/~/!/g' -e 's/^[ \t]*//' results.md
gh pr comment ${{ github.event.pull_request.number }} --body-file ./results.md
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.token }}