From c3c2e888ce71089b953303fc7ac79f13d44da707 Mon Sep 17 00:00:00 2001 From: Jules Belveze <32683010+JulesBelveze@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:57:01 +0100 Subject: [PATCH] [.github] - refactor: simplify triggering of dust-infra workflow (#8674) - Replace usage of github-script action with a curl command to trigger the dust-infra workflow dispatch - Remove redundant steps and clean up environment variable usage --- .github/workflows/deploy-connectors-infra.yml | 35 ++++++++----------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/.github/workflows/deploy-connectors-infra.yml b/.github/workflows/deploy-connectors-infra.yml index d3f4689d253f..d1951df46251 100644 --- a/.github/workflows/deploy-connectors-infra.yml +++ b/.github/workflows/deploy-connectors-infra.yml @@ -53,26 +53,19 @@ jobs: app-id: ${{ secrets.INFRA_DISPATCH_APP_ID }} private-key: ${{ secrets.INFRA_DISPATCH_APP_PRIVATE_KEY }} - - name: Use the token - env: - GH_TOKEN: ${{ steps.generate-token.outputs.token }} - run: | - gh api octocat - - name: Trigger dust-infra workflow - uses: actions/github-script@v7 - with: - github-token: ${{ steps.generate-token.outputs.token }} - script: | - await github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: 'dust-infra', - event_type: 'trigger-component-deploy', - workflow_id: 'deploy.yaml', - ref: 'main', - client_payload: { - us_central1: ${{ inputs.us-central1 }}, - component: 'connectors', - image_tag: '${{ steps.short_sha.outputs.short_sha }}' + 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 }}" } - }); + }' \ No newline at end of file