-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (27 loc) · 1.1 KB
/
main.yml
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
name: Terraform_Run
on:
workflow_dispatch:
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: GitHub credentials
run: |
# unset-all returns exit code 5 if run when the settings don't exist. || true ignores the failure
# https://manpages.ubuntu.com/manpages/trusty/man1/git-config.1.html
# Exit code 5 = You try to unset an option which does not exist
git config --global --unset-all credential.helper || true
# Note GITHUB_TOKEN is my PAT with read access to my private git repos to pull modules
git config --global url."https://oauth2:${{ secrets.GH_TOKEN }}@github.com".insteadOf https://github.com
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.4.1
- name: Terraform Init
run: terraform init
- name: Terraform Plan
run: terraform plan
- name: Terraform Apply
run: terraform apply -auto-approve