From 76a1c18b56fb4769159dfd5b62846107e9958aa6 Mon Sep 17 00:00:00 2001 From: htom Date: Wed, 5 Nov 2025 14:58:08 +0100 Subject: [PATCH] Workflow: dispatching workflow with 'uses' --- .github/workflows/dispatcher.yml | 70 ++++++++++++-------------------- 1 file changed, 25 insertions(+), 45 deletions(-) diff --git a/.github/workflows/dispatcher.yml b/.github/workflows/dispatcher.yml index c5d91fe..7111a69 100644 --- a/.github/workflows/dispatcher.yml +++ b/.github/workflows/dispatcher.yml @@ -44,50 +44,30 @@ jobs: echo "server=$SERVER" >> $GITHUB_OUTPUT echo "ui=$UI" >> $GITHUB_OUTPUT - - name: Trigger Engine Test - if: steps.check.outputs.engine == 'true' - uses: actions/github-script@v7 - with: - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'engine_test.yml', - ref: '${{ github.ref }}', - inputs: { - triggered_by: 'dispatch.yml', - branch: '${{ github.ref_name }}' - } - }) + engine: + needs: dispatch + if: needs.determine.outputs.engine == 'true' + uses: ./engine_test.yml + with: + branch: ${{ github.ref_name }} + secrets: inherit + + server: + needs: dispatch + if: needs.determine.outputs.server == 'true' + uses: ./server_test.yml + with: + branch: ${{ github.ref_name }} + secrets: inherit + + ui: + needs: dispatch + if: needs.determine.outputs.ui == 'true' + uses: ./ui_test.yml + with: + branch: ${{ github.ref_name }} + secrets: inherit + + - - name: Trigger Server Test - if: steps.check.outputs.server == 'true' - uses: actions/github-script@v7 - with: - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'server_test.yml', - ref: '${{ github.ref }}', - inputs: { - triggered_by: 'dispatch.yml', - branch: '${{ github.ref_name }}' - } - }) - - name: Trigger UI Test - if: steps.check.outputs.ui == 'true' - uses: actions/github-script@v7 - with: - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'ui_test.yml', - ref: '${{ github.ref }}', - inputs: { - triggered_by: 'dispatch.yml', - branch: '${{ github.ref_name }}' - } - }) -- 2.49.1