File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,18 +81,31 @@ jobs:
8181 return token
8282
8383 - name : Trigger all SDK workflow
84- uses : codex-/return-dispatch@v1
8584 id : return_dispatch
86- with :
87- token : ${{ steps.get_access_token.outputs.result }}
88- repo : xeroapi-sdk-codegen
89- owner : xero-internal
90- workflow : pr.yml
91- ref : refs/heads/master
92- workflow_inputs : >
93- {
94- "branch_name": "${{ github.event_name == 'pull_request' && github.head_ref || 'master' }}"
95- }
85+ env :
86+ GH_TOKEN : ${{ steps.get_access_token.outputs.result }}
87+ run : |
88+ BRANCH_NAME="${{ github.event_name == 'pull_request' && github.head_ref || 'master' }}"
89+
90+ # Trigger the workflow and capture the response
91+ gh workflow run pr.yml \
92+ --repo xero-internal/xeroapi-sdk-codegen \
93+ --ref master \
94+ --field branch_name="$BRANCH_NAME"
95+
96+ # Wait a moment for the run to be created
97+ sleep 5
98+
99+ # Get the latest run ID for the workflow
100+ RUN_ID=$(gh run list \
101+ --repo xero-internal/xeroapi-sdk-codegen \
102+ --workflow=pr.yml \
103+ --limit 1 \
104+ --json databaseId \
105+ --jq '.[0].databaseId')
106+
107+ echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT
108+ echo "Triggered workflow run ID: $RUN_ID"
96109
97110 - name : Checking SDK health status
98111 uses : Codex-/await-remote-run@v1.12.2
You can’t perform that action at this time.
0 commit comments