1
0
Fork 0
mirror of https://code.forgejo.org/actions/checkout.git synced 2025-05-04 09:19:55 +02:00

Adds force-api-download option

Signed-off-by: CollinM <collinmcneese@github.com>
This commit is contained in:
CollinM 2022-10-01 06:48:13 -05:00
parent e6d535c99c
commit a24ff48c7b
No known key found for this signature in database
GPG key ID: 6C1C8E02FD10FBA1
7 changed files with 23 additions and 3 deletions

View file

@ -71,7 +71,7 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
)
}
if (!git) {
if (!git || settings.forceApiDownload) {
// Downloading using REST API
core.info(`The repository will be downloaded using the GitHub REST API`)
core.info(

View file

@ -88,4 +88,9 @@ export interface IGitSourceSettings {
* User override on the GitHub Server/Host URL that hosts the repository to be cloned
*/
githubServerUrl: string | undefined
/**
* Force the use of API download instead of git commands
*/
forceApiDownload: boolean
}

View file

@ -130,5 +130,8 @@ export async function getInputs(): Promise<IGitSourceSettings> {
result.githubServerUrl = core.getInput('github-server-url')
core.debug(`GitHub Host URL = ${result.githubServerUrl}`)
// Toggle force-api-download
result.forceApiDownload =
(core.getInput('force-api-download') || 'false').toUpperCase() === 'TRUE'
return result
}