Skip to content

Commit 75ad418

Browse files
authored
Merge pull request #2 from soat-tech-challenge/feat/inherit-secrets
feat: inherit secrets
2 parents d085287 + 9c89cb1 commit 75ad418

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

.github/workflows/terraform-apply.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ on:
1313
config_directory:
1414
type: string
1515
default: "./"
16-
secrets:
17-
cloud_token:
18-
required: true
1916

2017
jobs:
21-
apply:
22-
name: Apply
18+
terraform_apply:
19+
name: Terraform Apply via Terraform Cloud API
2320
runs-on: ubuntu-latest
2421

22+
environment:
23+
name: ${{ inputs.cloud_workspace }}
24+
url: ${{ steps.apply-run.outputs.run_link }}
25+
2526
outputs:
2627
status: ${{ steps.apply-run.outputs.status }}
2728
payload: ${{ steps.apply-run.outputs.payload }}
@@ -31,7 +32,7 @@ jobs:
3132

3233
env:
3334
TF_CLOUD_ORGANIZATION: ${{ inputs.cloud_organization }}
34-
TF_API_TOKEN: ${{ secrets.cloud_token }}
35+
TF_API_TOKEN: ${{ secrets.TF_API_TOKEN }}
3536
TF_WORKSPACE: ${{ inputs.cloud_workspace }}
3637
CONFIG_DIRECTORY: ${{ inputs.config_directory }}
3738

.github/workflows/terraform-destroy.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ on:
66
inputs:
77
workspace:
88
type: string
9-
secrets:
10-
token:
11-
required: true
129

1310
jobs:
1411
terraform_destroy:
15-
name: Terraform Destroy
12+
name: Terraform Destroy via CLI
1613

1714
runs-on: ubuntu-latest
1815

@@ -28,7 +25,7 @@ jobs:
2825
- name: Setup Terraform
2926
uses: hashicorp/setup-terraform@v2
3027
with:
31-
cli_config_credentials_token: ${{ secrets.token }}
28+
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
3229

3330
- name: Terraform Init
3431
run: terraform init

0 commit comments

Comments
 (0)