Add objectFormat setting to allow init()ing a repo with sha256

This commit is contained in:
Yang Zhao 2024-08-23 00:23:06 -07:00
parent 85e6279cec
commit b9de40a228
9 changed files with 81 additions and 8 deletions

View file

@ -161,5 +161,14 @@ export async function getInputs(): Promise<IGitSourceSettings> {
result.githubServerUrl = core.getInput('github-server-url')
core.debug(`GitHub Host URL = ${result.githubServerUrl}`)
// Object format
const objectFormat = core.getInput('object-format')
if (objectFormat) {
if (objectFormat != 'sha1' && objectFormat != 'sha256') {
throw Error(`Invalid object format '${objectFormat}'`)
}
result.objectFormat = objectFormat
}
return result
}