3
0
Fork 0
mirror of https://code.forgejo.org/actions/checkout.git synced 2026-06-18 10:56:27 +00:00

Fix checkout init for SHA-256 repositories (#2439)

* Fix checkout init for SHA-256 repositories

* Remove unused object format result field
This commit is contained in:
Yashwanth Anantharaju 2026-06-01 11:35:58 -04:00 committed by GitHub
parent 900f2210b1
commit 1cce3390c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 282 additions and 7 deletions

View file

@ -109,8 +109,25 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
if (
!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))
) {
core.startGroup('Determining repository object format')
const objectFormatResult =
await githubApiHelper.tryGetRepositoryObjectFormat(
settings.authToken,
settings.repositoryOwner,
settings.repositoryName,
settings.githubServerUrl,
settings.commit
)
const objectFormat = objectFormatResult.succeeded
? objectFormatResult.format
: ''
if (objectFormat === 'sha256') {
core.info('Detected SHA-256 repository object format')
}
core.endGroup()
core.startGroup('Initializing the repository')
await git.init()
await git.init(objectFormat)
await git.remoteAdd('origin', repositoryUrl)
core.endGroup()
}