Skip to content

Commit 453f42f

Browse files
JackLau1222github-actions[bot]
authored andcommitted
CI: Fix the trigger bug
Signed-off-by: Jack Lau <jacklau1222gm@gmail.com>
1 parent bc88e8b commit 453f42f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/auto-rebase.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ jobs:
5050

5151
- name: Trigger test workflow
5252
if: matrix.branch == 'workflows'
53-
run: gh workflow run test.yml --ref ${{ matrix.branch }}
53+
run: |
54+
WORKFLOW_ID=$(gh api "repos/${GITHUB_REPOSITORY}/actions/workflows" \
55+
-q '.workflows[] | select(.path==".github/workflows/test.yml") | .id')
56+
if [ -n "$WORKFLOW_ID" ]; then
57+
gh api -X POST "repos/${GITHUB_REPOSITORY}/actions/workflows/${WORKFLOW_ID}/dispatches" \
58+
-f ref=workflows
59+
fi
5460
env:
5561
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)