Skip to content

Commit a7f0955

Browse files
committed
minimal-sdk: heed the revision of the latest successful ci-artifacts run
We specifically look for the `git-sdk-64` revision that let the `ci-artifacts` run succeed. But then we simply ignore it. Let's not. There is a reason why we do not want to use a revision which caused `ci-artifacts` to fail... Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 7e2d877 commit a7f0955

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/git.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,31 @@ async function clone(
8080
})
8181
}
8282

83+
async function updateHEAD(
84+
bareRepositoryPath: string,
85+
headSHA: string
86+
): Promise<void> {
87+
const child = spawn(
88+
gitExePath,
89+
['--git-dir', bareRepositoryPath, 'update-ref', 'HEAD', headSHA],
90+
{
91+
env: {
92+
GIT_CONFIG_PARAMETERS
93+
},
94+
stdio: [undefined, 'inherit', 'inherit']
95+
}
96+
)
97+
return new Promise<void>((resolve, reject) => {
98+
child.on('close', code => {
99+
if (code === 0) {
100+
resolve()
101+
} else {
102+
reject(new Error(`git: exited with code ${code}`))
103+
}
104+
})
105+
})
106+
}
107+
83108
export async function getViaGit(
84109
flavor: string,
85110
architecture: string,
@@ -158,6 +183,7 @@ export async function getViaGit(
158183
}
159184
)
160185
} else {
186+
await updateHEAD('.tmp', head_sha)
161187
core.startGroup('Cloning build-extra')
162188
await clone(
163189
`https://github.com/${owner}/build-extra`,

0 commit comments

Comments
 (0)