Skip to content

data: regenerating based on the latest Swagger (#4516) #1248

data: regenerating based on the latest Swagger (#4516)

data: regenerating based on the latest Swagger (#4516) #1248

---
name: Regenerate the Go SDK
on:
push:
branches:
- main
paths:
- 'api-definitions/**'
- 'tools/generator-go-sdk/**'
workflow_dispatch: # for manual invocations
concurrency:
group: 'regengosdk-${{ github.head_ref }}'
cancel-in-progress: true
jobs:
regenerate-go-sdk:
runs-on: custom-linux-large
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: '1.21.3'
- 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 Go SDK repository
echo "${{ secrets.GOSDK_DEPLOYMENT_WRITE_KEY }}" | ssh-add -
env:
SSH_AUTH_SOCK: /tmp/pandora_ssh_agent.sock
- name: "Run the Go SDK Generator"
run: |
# go go gadget generator
./scripts/automation-generate-and-commit-go-sdk.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