@@ -87,41 +87,18 @@ jobs:
8787
8888 - name : Wait for Internal Tests to complete
8989 if : steps.filter.outputs.non_docs == 'true'
90- uses : actions/github-script@v7
91- with :
92- github-token : ${{ secrets.SPACETIMEDB_PRIVATE_TOKEN }}
93- script : |
94- const targetOwner = process.env.TARGET_OWNER;
95- const targetRepo = process.env.TARGET_REPO;
96- const runId = Number(`${{ steps.dispatch.outputs.run_id }}`);
97- const runUrl = `${{ steps.dispatch.outputs.run_url }}`;
98- const sleep = (ms) => new Promise(r => setTimeout(r, ms));
99-
100- core.info(`Waiting for workflow result... ${runUrl}`);
101-
102- let conclusion = null;
103- for (let attempt = 0; attempt < 240; attempt++) { // up to ~2 hours
104- const runResp = await github.rest.actions.getWorkflowRun({
105- owner: targetOwner,
106- repo: targetRepo,
107- run_id: runId
108- });
109- const { status, conclusion: c } = runResp.data;
110- if (status === 'completed') {
111- conclusion = c || 'success';
112- break;
113- }
114- await sleep(30000);
115- }
116-
117- if (!conclusion) {
118- core.setFailed('Timed out waiting for private workflow to complete.');
119- return;
120- }
121-
122- if (conclusion !== 'success') {
123- core.setFailed(`Private workflow failed with conclusion: ${conclusion}`);
124- }
90+ env :
91+ GH_TOKEN : ${{ secrets.SPACETIMEDB_PRIVATE_TOKEN }}
92+ RUN_ID : ${{ steps.dispatch.outputs.run_id }}
93+ RUN_URL : ${{ steps.dispatch.outputs.run_url }}
94+ run : |
95+ set -euo pipefail
96+ echo "Waiting for workflow result... ${RUN_URL}"
97+ gh run watch "$RUN_ID" \
98+ --repo "$TARGET_OWNER/$TARGET_REPO" \
99+ --exit-status \
100+ --compact \
101+ --interval 30
125102
126103 - name : Cancel invoked run if workflow cancelled
127104 if : ${{ cancelled() && steps.dispatch.outputs.run_id }}
0 commit comments