Skip to content

Terraform Auto-Refresh #1383

Terraform Auto-Refresh

Terraform Auto-Refresh #1383

name: Terraform Auto-Refresh
on:
workflow_dispatch:
schedule:
- cron: "0 6,18 * * *"
permissions: write-all
jobs:
terraform-layer-deploy:
uses: jtcressy-home/actions-workflows/.github/workflows/terraform.yml@main
with:
path: /layers/deploy
environment: vault-deploy
tailscale: false
action: plan
arguments: -refresh-only
debug: ${{ github.event.inputs.debug || false }}
secrets: inherit
terraform-layer-config:
uses: jtcressy-home/actions-workflows/.github/workflows/terraform.yml@main
with:
path: /layers/config
environment: vault-config
vault: https://vault.jtcressy.net
tailscale: false
action: plan
arguments: -refresh-only
debug: ${{ github.event.inputs.debug || false }}
secrets: inherit
terraform-layer-deploy-has-changes:
runs-on: ubuntu-latest
needs:
- terraform-layer-deploy
steps:
- uses: actions/checkout@v4
- name: Create/Update Issue
id: create-issue
if: needs.terraform-layer-deploy.outputs.plan-has-changes == 'true'
uses: JasonEtco/create-an-issue@v2
env:
TF_LAYER: deploy
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLAN_OUTPUT: ${{ needs.terraform-layer-deploy.outputs.plan-output }}
with:
filename: .github/config-drift-issue.md
update_existing: true
terraform-layer-config-has-changes:
runs-on: ubuntu-latest
needs:
- terraform-layer-config
steps:
- uses: actions/checkout@v4
- name: Create/Update Issue
id: create-issue
if: needs.terraform-layer-config.outputs.plan-has-changes == 'true'
uses: JasonEtco/create-an-issue@v2
env:
TF_LAYER: config
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLAN_OUTPUT: ${{ needs.terraform-layer-config.outputs.plan-output }}
with:
filename: .github/config-drift-issue.md
update_existing: true