Skip to content

Instantly share code, notes, and snippets.

@billinghamj
Created April 13, 2022 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billinghamj/2a127b9cbd475e6b210d10431ccdde30 to your computer and use it in GitHub Desktop.
Save billinghamj/2a127b9cbd475e6b210d10431ccdde30 to your computer and use it in GitHub Desktop.
.terraform.lock.hcl platforms
on:
pull_request_target:
paths:
- 'infra/**/.terraform.lock.hcl'
- '.github/workflows/terraform-providers.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
working-directory: infra
jobs:
terraform-providers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.0.0
with:
ref: refs/pull/${{ github.event.number }}/merge
token: ${{ secrets.GH_MACHINE_PAT }}
- uses: hashicorp/setup-terraform@v1.4.0
- name: update provider lock files
run: |
workspaces=$(find . -name .terraform.lock.hcl -print0 | xargs -0 -n1 dirname | sort)
for workspace in $workspaces; do
echo "==> $workspace"
(
cd $workspace
terraform init \
-input=false \
-backend=false
terraform providers lock \
-platform=darwin_arm64 \
-platform=linux_amd64 \
-platform=linux_arm64
)
done
- uses: stefanzweifel/git-auto-commit-action@v4.14.1
with:
commit_message: update provider lock files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment