fix: move workflow to repo root, add working-directory for terraform
All checks were successful
Terraform / terraform (push) Successful in 13s
All checks were successful
Terraform / terraform (push) Successful in 13s
This commit is contained in:
@@ -9,6 +9,10 @@ on:
|
||||
env:
|
||||
TF_VAR_netbird_token: ${{ secrets.NETBIRD_TOKEN }}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: terraform
|
||||
|
||||
jobs:
|
||||
terraform:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -41,10 +45,11 @@ jobs:
|
||||
|
||||
- name: Commit state changes
|
||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
working-directory: .
|
||||
run: |
|
||||
git config user.name "Terraform CI"
|
||||
git config user.email "ci@localhost"
|
||||
git add terraform.tfstate terraform.tfstate.backup 2>/dev/null || true
|
||||
git add terraform/terraform.tfstate terraform/terraform.tfstate.backup 2>/dev/null || true
|
||||
if ! git diff --staged --quiet; then
|
||||
git commit -m "chore: update terraform state [skip ci]"
|
||||
git push
|
||||
Reference in New Issue
Block a user