-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (34 loc) · 1.12 KB
/
update-repos.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
36
37
38
39
40
41
42
43
name: Update Repos' Environments
on:
push:
branches:
- main
- master
schedule:
- cron: "0 2 * * *" # Runs at 2:00 AM UTC every night
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
terraform:
name: Apply Terraform
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.5.0 # Use the latest Terraform version or the version you need
- name: Initialize Terraform
run: terraform init
- name: Validate Terraform
run: terraform validate
- name: Plan Terraform
run: terraform plan
#- name: Apply Terraform
# run: terraform apply -auto-approve
env:
TF_VAR_github_owner: ${{ github.actor }}
TF_VAR_github_token: ${{ secrets.GITHUB_TOKEN }}
TF_TOKEN_app_terraform_io: ${{ secrets.TF_TOKEN }} # used as a bearer authorization token when the CLI makes service requests to the hostname app.terraform.io