From 93ab5200ea7f505b1fa41994c8bec99b7c2be155 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 7 Sep 2023 14:23:13 -0400 Subject: [PATCH] Switch automatic action to use repository_dispatch, so it can be invoked from an external repo --- .github/workflows/automatic-api-update.yaml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/automatic-api-update.yaml b/.github/workflows/automatic-api-update.yaml index 62200a8..02a6c7a 100644 --- a/.github/workflows/automatic-api-update.yaml +++ b/.github/workflows/automatic-api-update.yaml @@ -1,11 +1,7 @@ name: Called update for API change on: - workflow_call: - inputs: - buftag: - description: Tag or commit from https://buf.build/authzed/api/tags/main - required: true - type: string + repository_dispatch: + types: [api_update] jobs: test: name: "Create PR for API update" @@ -18,7 +14,7 @@ jobs: id: buf-update uses: authzed/actions/buf-api-update@main with: - api-commit: ${{ inputs.buftag }} + api-commit: ${{ github.event.client_payload.BUFTAG }} spec-path: buf.gen.yaml file-format: generate-shell-script - name: "Output update status" @@ -59,6 +55,6 @@ jobs: if: steps.buf-update.outputs.updated == 'true' with: delete-branch: "true" - title: Update API to ${{ inputs.buftag }} - branch: api-change/${{ inputs.buftag }} + title: Update API to ${{ github.event.client_payload.BUFTAG }} + branch: api-change/${{ github.event.client_payload.BUFTAG }} token: ${{ secrets.GITHUB_TOKEN }}