Skip to content

Merge pull request #2737 from hashicorp/data-api/support-common-types #592

Merge pull request #2737 from hashicorp/data-api/support-common-types

Merge pull request #2737 from hashicorp/data-api/support-common-types #592

---
name: Regenerate the Terraform Provider
on:
push:
branches:
- main
paths:
- 'data/**'
- 'tools/generator-terraform/**'
concurrency:
group: 'regenterraform-${{ github.head_ref }}'
cancel-in-progress: true
jobs:
regenerate-terraform-provider:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: '1.19.3'
- name: Setup .NET
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
with:
dotnet-version: 7.0.x
- name: "Build Data API"
run: |
cd ./data
make build
- name: "Launch SSH Agent"
run: |
# launch an ssh agent and export it's env vars
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
env:
SSH_AUTH_SOCK: /tmp/pandora_ssh_agent.sock
- name: "Load SSH Key"
run: |
# load the Deployment Write Key for the Terraform Provider AzureRM repository
echo "${{ secrets.TERRAFORM_AZURERM_PUBLIC_DEPLOYMENT_WRITE_KEY }}" | ssh-add -
env:
SSH_AUTH_SOCK: /tmp/pandora_ssh_agent.sock
- name: "Run the Terraform Generator"
run: |
# go go gadget generator
./scripts/automation-generate-and-commit-terraform.sh
env:
SSH_AUTH_SOCK: /tmp/pandora_ssh_agent.sock
- name: "Remove the Key from the SSH Agent"
if: always()
run: |
# remove the ssh key
ssh-add -D
env:
SSH_AUTH_SOCK: /tmp/pandora_ssh_agent.sock
- name: "Terminate the SSH Agent"
if: always()
run: |
pkill -9 ssh-agent