Created
April 13, 2022 13:53
-
-
Save billinghamj/2a127b9cbd475e6b210d10431ccdde30 to your computer and use it in GitHub Desktop.
.terraform.lock.hcl platforms
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
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