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:
parent
e6d535c99c
commit
a24ff48c7b
7 changed files with 23 additions and 3 deletions
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue