Skip to content

Commit 7f94331

Browse files
authored
Merge pull request #21 from GetTerminus/dpr-fix-default-version
fix: default version and author
2 parents b15399d + 66eca3a commit 7f94331

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

action.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: 'Terraform and TFLint PR Commenter'
22
description: 'Adds opinionated comments to a PR from Terraform fmt/init/plan/validate/tflint output'
3-
author: 'Rob Burger'
3+
author: 'GetTerminus'
44
branding:
55
icon: 'git-pull-request'
66
color: 'blue'
@@ -20,22 +20,32 @@ inputs:
2020
terraform_version:
2121
description: 'The version of terraform from the workflow.'
2222
required: false
23-
default: "1.4.6"
23+
default: '1.4.6'
2424
use_beta_version:
2525
description: 'Whether to use the beta version of the commenter'
2626
required: false
2727
default: 'false'
2828
runs:
2929
using: "composite"
3030
steps:
31+
- name: Set Terraform Version if inputs.terraform_version is Empty # Until https://github.com/actions/runner/issues/924 is fixed
32+
id: tf_version
33+
run: |
34+
if [[ -z ${{ inputs.terraform_version }} ]]; then
35+
echo "version=1.4.6" >> $GITHUB_OUTPUT
36+
else
37+
echo "version=${{ inputs.terraform_version }}" >> $GITHUB_OUTPUT
38+
fi
39+
shell: bash
3140
- name: Build commenter docker image (master)
3241
if: ${{ inputs.use_beta_version != 'true' }}
33-
run: docker build --build-arg TERRAFORM_VERSION=${{ inputs.terraform_version }} -t commenter https://github.com/GetTerminus/terraform-pr-commenter.git#v3
42+
run: docker build --build-arg TERRAFORM_VERSION=${{ steps.tf_version.outputs.version }} -t commenter https://github.com/GetTerminus/terraform-pr-commenter.git#v3
3443
shell: bash
3544
- name: Build commenter docker image (beta)
3645
if: ${{ inputs.use_beta_version == 'true' }}
3746
# append branch with a pound (#) if developing. e.g., `commenter.git#my-branch`
38-
run: docker build --build-arg TERRAFORM_VERSION=${{ inputs.terraform_version }} -t commenter https://github.com/GetTerminus/terraform-pr-commenter.git#v3-beta
47+
run: |
48+
docker build --build-arg TERRAFORM_VERSION=${{ steps.tf_version.outputs.version }} -t commenter https://github.com/GetTerminus/terraform-pr-commenter.git#v3-beta
3949
shell: bash
4050
- name: Run commenter image (plan)
4151
if: ${{ inputs.commenter_type == 'plan' }}

0 commit comments

Comments
 (0)