-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (42 loc) · 1.63 KB
/
terraform-modules-auth-test.yaml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: terraform modules auth using github app installation token
on:
workflow_dispatch:
#These environment variables are used by the terraform azure provider to setup OIDD authenticate.
env:
ARM_CLIENT_ID: "${{ secrets.AZURE_CLIENT_ID }}"
ARM_SUBSCRIPTION_ID: "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
ARM_TENANT_ID: "${{ secrets.AZURE_TENANT_ID }}"
ARM_CLIENT_SECRET: "${{ secrets.AZURE_CLIENT_SECRET }}"
run-name: terraform modules auth using github app installation token
jobs:
terraform-modules-auth-using-github-app-installation-token:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: checking files
run: ls -latR
- name: Token generator
uses: githubofkrishnadhas/github-access-using-githubapp@v1
with:
github_app_id: ${{ secrets.TOKEN_GENERATOR_APPID }}
github_app_private_key: ${{ secrets.TOKEN_GENERATOR_PRIVATE_KEY }}
github_account_type: 'user'
- name: setup for tfmodule
run: |
git config --local --remove-section http."https://github.com/"
git config --global url."https://githubofkrishnadhas:${GH_APP_TOKEN}@github.com/devwithkrishna".insteadOf "https://github.com/devwithkrishna"
- name: terraform setup
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.5.7"
- name: terraform checking
run: terraform --version
- name: terraform init
run: terraform init
- name: terraform plan
run: terraform plan -out=plan.out
- name: check plan.out
run: ls -latR
- name: terraform apply
run: terraform apply --auto-approve