Skip to content

Commit

Permalink
[.github] - refactor: simplify triggering of dust-infra workflow (#8674)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
JulesBelveze authored Nov 15, 2024
1 parent 8964d96 commit c3c2e88
Showing 1 changed file with 14 additions and 21 deletions.
35 changes: 14 additions & 21 deletions .github/workflows/deploy-connectors-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
}
});
}'

0 comments on commit c3c2e88

Please sign in to comment.