From 44b13ed302c9eac18ea5c99991df6bd2f108cd5d Mon Sep 17 00:00:00 2001 From: Flavien David Date: Fri, 15 Nov 2024 14:08:56 +0100 Subject: [PATCH] Target specific repo in GH action app token (#8676) --- .github/workflows/deploy-connectors-infra.yml | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy-connectors-infra.yml b/.github/workflows/deploy-connectors-infra.yml index d1951df46251..3c687e86f2f4 100644 --- a/.github/workflows/deploy-connectors-infra.yml +++ b/.github/workflows/deploy-connectors-infra.yml @@ -52,20 +52,22 @@ jobs: with: app-id: ${{ secrets.INFRA_DISPATCH_APP_ID }} private-key: ${{ secrets.INFRA_DISPATCH_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + repositories: | + dust-infra - name: Trigger dust-infra workflow - run: | - curl -L \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ steps.generate-token.outputs.token }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/dust-tt/dust-infra/dispatches \ - -d '{ - "event_type": "trigger-component-deploy", - "client_payload": { - "us_central1": ${{ inputs.us-central1 }}, - "component": "connectors", - "image_tag": "${{ steps.short_sha.outputs.short_sha }}" + uses: actions/github-script@v6 + with: + github-token: ${{ steps.generate-token.outputs.token }} + script: | + await github.rest.repos.createDispatchEvent({ + owner: ${{ github.repository_owner }}, + repo: 'dust-infra', + event_type: 'trigger-component-deploy', + client_payload: { + us_central1: ${{ inputs.us-central1 }}, + component: 'connectors', + image_tag: '${{ steps.short_sha.outputs.short_sha }}' } - }' \ No newline at end of file + });