From 88e580bc861c770a2f4958d0f210a9d5dc3dca8f Mon Sep 17 00:00:00 2001 From: Jaehyun Lim Date: Wed, 1 Jul 2026 14:09:44 -0700 Subject: [PATCH] ci: trigger amp-common Go type regen on api spec changes When api/** changes on main, dispatch a repository_dispatch event to amp-common so it regenerates the Go types derived from api/api.yaml and opens a PR. Mirrors the existing trigger-docs-gen / trigger-postman workflows. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/trigger-amp-common-gen.yml | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/trigger-amp-common-gen.yml diff --git a/.github/workflows/trigger-amp-common-gen.yml b/.github/workflows/trigger-amp-common-gen.yml new file mode 100644 index 0000000..c27f595 --- /dev/null +++ b/.github/workflows/trigger-amp-common-gen.yml @@ -0,0 +1,26 @@ +name: Trigger amp-common Go type generation + +# When the API spec changes on main, tell amp-common to regenerate the Go types +# it derives from api/api.yaml (via api/generated/api.json) and open a PR. + +on: + push: + branches: + - main + paths: + - 'api/**' + workflow_dispatch: + +jobs: + trigger: + runs-on: ubuntu-latest + steps: + - name: Dispatch to amp-common + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.AMPERSAND_OPS_PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/amp-labs/amp-common/dispatches \ + -d '{"event_type":"gen-openapi-types","client_payload":{"repository":"${{ github.repository }}","sha":"${{ github.sha }}"}}'