permission to write contents #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: write | |
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 }} |