Merge e7667abffb0c8a9a3777db9276d640bfeb8b68ff into 0c366fd6a839edf440554fa01a7085ccba70ac98

This commit is contained in:
Vìncent Le Goff 2026-01-10 01:41:19 +05:30 committed by GitHub
commit 0c6e71a574
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 0 deletions

View File

@ -98,6 +98,10 @@ inputs:
github-server-url: github-server-url:
description: The base URL for the GitHub instance that you are trying to clone from, will use environment defaults to fetch from the same instance that the workflow is running from unless specified. Example URLs are https://github.com or https://my-ghes-server.example.com description: The base URL for the GitHub instance that you are trying to clone from, will use environment defaults to fetch from the same instance that the workflow is running from unless specified. Example URLs are https://github.com or https://my-ghes-server.example.com
required: false required: false
skip-cleanup:
description: Skips the cleanup phase on post action hook
required: false
default: false
outputs: outputs:
ref: ref:
description: 'The branch, tag or SHA that was checked out' description: 'The branch, tag or SHA that was checked out'

View File

@ -118,4 +118,9 @@ export interface IGitSourceSettings {
* User override on the GitHub Server/Host URL that hosts the repository to be cloned * User override on the GitHub Server/Host URL that hosts the repository to be cloned
*/ */
githubServerUrl: string | undefined githubServerUrl: string | undefined
/**
* Disable the post action cleanup phase
*/
skipCleanup: boolean
} }

View File

@ -30,6 +30,12 @@ async function run(): Promise<void> {
} }
async function cleanup(): Promise<void> { async function cleanup(): Promise<void> {
const sourceSettings = await inputHelper.getInputs()
if (sourceSettings.skipCleanup) {
return
}
try { try {
await gitSourceProvider.cleanup(stateHelper.RepositoryPath) await gitSourceProvider.cleanup(stateHelper.RepositoryPath)
} catch (error) { } catch (error) {