Skip to content

Commit 99173b9

Browse files
committed
bump omicron script: automatically run gh run watch when assets aren't ready
1 parent 2cfc8ee commit 99173b9

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tools/deno/bump-omicron.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ const VERSION_FILE = path.join(OMICRON_DIR, 'tools/console_version')
3434
const GH_MISSING = 'GitHub CLI not found. Please install it and try again.'
3535
const VERSION_FILE_MISSING = `Omicron console version file at '${VERSION_FILE}' not found. This script assumes Omicron is cloned in a sibling directory next to Console.`
3636

37-
const getUploadAssetsWorkflowId = () =>
38-
$`gh run list -L 1 -w 'Upload assets to dl.oxide.computer' --json databaseId --jq '.[0].databaseId'`.text()
39-
4037
/**
4138
* These lines get printed in an Omicron PR, so any references to commits or
4239
* issues need to be qualified.
@@ -78,16 +75,20 @@ const shaUrl = `https://dl.oxide.computer/releases/console/${newCommit}.sha256.t
7875
const shaResp = await fetch(shaUrl)
7976

8077
if (!shaResp.ok) {
78+
const workflowId =
79+
await $`gh run list -L 1 -w 'Upload assets to dl.oxide.computer' --json databaseId --jq '.[0].databaseId'`.text()
8180
console.error(
8281
`
83-
Failed to fetch console tarball SHA. Either the current commit has not been pushed to origin/main or the CI job that uploads the assets is still running.
82+
Failed to fetch console tarball SHA. Either the current commit is not on origin/main or the asset upload job is still running.
83+
84+
Status: ${shaResp.status}
85+
URL: ${shaUrl}
86+
Body: ${await shaResp.text()}
8487
85-
Run 'gh run watch ${await getUploadAssetsWorkflowId()}' to watch the latest asset upload action.
88+
Running 'gh run watch ${workflowId}' to watch the current upload action.
8689
`
8790
)
88-
console.error('URL:', shaUrl)
89-
console.error('Status:', shaResp.status)
90-
console.error('Body:', await shaResp.text())
91+
await $`gh run watch ${workflowId}`
9192
Deno.exit(1)
9293
}
9394

0 commit comments

Comments
 (0)