diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 52a03a925..2d6350805 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -77,9 +77,13 @@ jobs: unzip -q awscliv2.zip fi ./aws/install + # https://github.com/dflook/terraform-github-actions/tree/main/terraform-apply#applying-a-plan-using-a-comment + PR_CHECKOUT_REF: refs/pull/${{ github.event.issue.number }}/merge steps: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + ref: ${{ github.event_name == 'issue_comment' && env.PR_CHECKOUT_REF || '' }} - name: Assume AWS Role if AWS_ROLE_ARN var is set uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 @@ -128,7 +132,7 @@ jobs: - name: Terraform apply uses: dflook/terraform-apply@7d435d4d115a11e5db1e710ac969f5382f0f6f9f # v1.44.0 - if: github.event_name == 'push' || inputs.terraform_operation == 'apply' + if: github.event_name == 'push' || inputs.terraform_operation == 'apply' || (github.event_name == 'issue_comment' && contains(github.event.comment.body, 'terraform apply')) with: label: ${{ vars.RESOURCE_NAME }} ${{ inputs.terraform_root_path }} path: ${{ inputs.terraform_root_path }} diff --git a/docs/README.md b/docs/README.md index e70eea5e8..60fd00272 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1609,6 +1609,9 @@ on: branches: - main - develop + # optional - to trigger a terraform apply adding a pr comment with text 'terraform apply' + issue_comment: + types: [created] workflow_dispatch: inputs: terraform_operation: diff --git a/version.txt b/version.txt index d18077c21..2d88a61ba 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v7.0.0 +v7.1.0