-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (41 loc) · 1.29 KB
/
apply.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
44
45
46
47
48
name: "Apply org changes"
on:
push:
branches:
- main
paths:
- 'terraform/production/*.tfvars'
- 'terraform/*.tf'
concurrency:
group: terraform-actions
jobs:
apply-changes:
name: "Org changes apply"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: terraform apply
# v1.44.0
# Use the commit hash for security hardening
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions
uses: dflook/terraform-apply@7d435d4d115a11e5db1e710ac969f5382f0f6f9f
env:
TERRAFORM_ACTIONS_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: "terraform"
variables: |
github_token = "${{ secrets.TERRAFORM_MANAGEMENT_GITHUB_TOKEN }}"
var_file: |
terraform/production/org.tfvars
terraform/production/repositories.tfvars
- name: Commit changes
if: ${{ always() }}
uses: devops-infra/[email protected]
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
commit_prefix: "[AUTO]"
commit_message: "State changes after apply"
force: false