Skip to content

Commit 81876cb

Browse files
committed
changed the apply yml to match the plan
1 parent 15df10a commit 81876cb

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

.github/workflows/terraform-apply.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,25 @@
1-
name: 'Terraform'
2-
3-
# on:
4-
# workflow_dispatch: # manual action run
1+
name: 'Terraform Apply'
52

63
on:
7-
push:
8-
branches:
9-
- PP-12736-tf-workflow
4+
issue_comment:
5+
types: [edited, created]
106

117
permissions:
128
contents: read
139

1410
jobs:
1511
terraform:
1612
name: 'Terraform Apply'
17-
runs-on: ubuntu-latest
18-
environment: development
19-
defaults:
20-
run:
21-
shell: bash
13+
runs-on: self-hosted
14+
if: |
15+
github.event.issue.pull_request &&
16+
contains(github.event.comment.body, '/terraform_apply')
2217
2318
steps:
2419
# Checkout the repository to the GitHub Actions runner
2520
- name: Checkout
2621
uses: actions/checkout@v3
2722

28-
# Install the latest version of Terraform
29-
- name: Setup Terraform
30-
uses: hashicorp/setup-terraform@v3
31-
32-
3323
# Run Terraform commands
3424
- name: Terraform Init
3525
run: terraform init
@@ -58,5 +48,5 @@ jobs:
5848
TF_VAR_timezone: ${{ vars.TIMEZONE }}
5949
TF_VAR_ssh_access_source_ranges: ${{ vars.SSH_ACCESS_SOURCE_RANGES }}
6050
TF_VAR_ui_access_source_ranges: ${{ vars.UI_ACCESS_SOURCE_RANGES }}
61-
TF_VAR_deployment_name: ${{ vars.DEPLOYMENT_NAME }}
51+
TF_VAR_deployment_name: "github-${{ github.event.pull_request.number }}-${{ github.run_id }}"
6252
TF_VAR_instance_name: ${{ vars.INSTANCE_NAME }}

0 commit comments

Comments
 (0)