Skip to content

Commit 7317e58

Browse files
committed
getViaGit(): support the minimal flavor
All we need to do there is to make _really_ sure that we only use a `git-sdk-64` commit for which the corresponding `ci-artifacts` run succeeded. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent cbae4ff commit 7317e58

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/git.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,24 @@ export async function getViaGit(
6969
const artifactName = `${repo}-${flavor}`
7070

7171
const octokit = new Octokit()
72-
const info = await octokit.repos.getBranch({
73-
owner,
74-
repo,
75-
branch: 'main'
76-
})
77-
const id = info.data.commit.sha
72+
let id: string
73+
if (flavor === 'minimal') {
74+
const info = await octokit.actions.listWorkflowRuns({
75+
owner,
76+
repo,
77+
workflow_id: 938271,
78+
status: 'success',
79+
per_page: 1
80+
})
81+
id = info.data.workflow_runs[0].head_sha
82+
} else {
83+
const info = await octokit.repos.getBranch({
84+
owner,
85+
repo,
86+
branch: 'main'
87+
})
88+
id = info.data.commit.sha
89+
}
7890
core.notice(`Got ID ${id} for ${repo}`)
7991

8092
return {

0 commit comments

Comments
 (0)