This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new bb1a3edce ci: Trigger CI workflow correctly (#6847)
bb1a3edce is described below

commit bb1a3edcecfae4a6468def2975b93dbfd4b8ce5f
Author: Xuanwo <[email protected]>
AuthorDate: Mon Dec 1 17:42:42 2025 +0800

    ci: Trigger CI workflow correctly (#6847)
    
    * ci: Trigger CI workflow correctly
    
    Signed-off-by: Xuanwo <[email protected]>
    
    * Fix
    
    Signed-off-by: Xuanwo <[email protected]>
    
    ---------
    
    Signed-off-by: Xuanwo <[email protected]>
---
 .github/workflows/full-ci-promote.yml | 46 +++++++++++++++++++++++++++--------
 1 file changed, 36 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/full-ci-promote.yml 
b/.github/workflows/full-ci-promote.yml
index 7ca1e0234..8bf3bceeb 100644
--- a/.github/workflows/full-ci-promote.yml
+++ b/.github/workflows/full-ci-promote.yml
@@ -30,6 +30,7 @@ permissions:
   contents: write
   pull-requests: write
   issues: write
+  workflows: write
 
 jobs:
   promote:
@@ -55,7 +56,7 @@ jobs:
           git checkout -B "${TARGET_BRANCH}" remotes/contrib/head
           git push --force origin "${TARGET_BRANCH}"
 
-      - name: Create or update internal PR
+      - name: Create or update mirror PR
         id: create_internal_pr
         uses: actions/github-script@v7
         env:
@@ -77,8 +78,8 @@ jobs:
               per_page: 1,
             });
 
-            let internalPr = existing[0];
-            if (!internalPr) {
+            let mirrorPr = existing[0];
+            if (!mirrorPr) {
               const title = `[CI] Full run for 
#${context.payload.pull_request.number}`;
               const body = [
                 `Mirrored branch for PR 
#${context.payload.pull_request.number}.`,
@@ -87,29 +88,54 @@ jobs:
               ].join('\n');
 
               const createResp = await github.rest.pulls.create({ owner, repo, 
head: headParam, base, title, body });
-              internalPr = createResp.data;
+              mirrorPr = createResp.data;
             }
 
-            core.setOutput('internal_pr_number', internalPr.number);
-            core.setOutput('internal_pr_html_url', internalPr.html_url);
+            core.setOutput('mirror_pr_number', mirrorPr.number);
+            core.setOutput('mirror_pr_html_url', mirrorPr.html_url);
+
+      - name: Trigger CI workflows
+        uses: actions/github-script@v7
+        env:
+          TARGET_BRANCH: ci/pr-${{ github.event.pull_request.number }}
+        with:
+          script: |
+            const workflows = [
+              'ci_core.yml',
+              'test_behavior.yml',
+            ];
+            const owner = context.repo.owner;
+            const repo = context.repo.repo;
+            const ref = process.env.TARGET_BRANCH;
+
+            for (const workflow of workflows) {
+              await github.rest.actions.createWorkflowDispatch({
+                owner,
+                repo,
+                workflow_id: workflow,
+                ref,
+              });
+              core.info(`Dispatched ${workflow} on ref ${ref}`);
+            }
 
       - name: Comment on PR
         uses: actions/github-script@v7
         env:
-          INTERNAL_PR: ${{ steps.create_internal_pr.outputs.internal_pr_number 
|| '' }}
-          INTERNAL_PR_URL: ${{ 
steps.create_internal_pr.outputs.internal_pr_html_url || '' }}
+          MIRROR_PR: ${{ steps.create_internal_pr.outputs.mirror_pr_number || 
'' }}
+          MIRROR_PR_URL: ${{ 
steps.create_internal_pr.outputs.mirror_pr_html_url || '' }}
         with:
           script: |
             const marker = '<!-- ci-bot:full-ci -->';
             const prNumber = context.payload.pull_request.number;
             const owner = context.repo.owner;
             const repo = context.repo.repo;
-            const internalUrl = process.env.INTERNAL_PR_URL;
+            const mirrorUrl = process.env.MIRROR_PR_URL;
 
             const body = [
               marker,
               'Maintainer triggered full CI with repository secrets.',
-              `Please monitor the mirrored CI PR for results: ${internalUrl}`,
+              `Please monitor the mirrored CI PR for results: ${mirrorUrl}`,
+              'Workflows dispatched: ci_core.yml, test_behavior.yml.',
               'Re-applying the label will refresh this mirror.',
             ].join('\n');
 

Reply via email to