feat(inputs): add option to disable the post action

This commit is contained in:
Vincent Le Goff 2025-07-28 15:23:38 +02:00
parent 8edcb1bdb4
commit e7667abffb
No known key found for this signature in database
GPG Key ID: 3A8C7592BECB15C3
3 changed files with 15 additions and 0 deletions

View File

@ -98,6 +98,10 @@ inputs:
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
required: false
skip-cleanup:
description: Skips the cleanup phase on post action hook
required: false
default: false
outputs:
ref:
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
*/
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> {
const sourceSettings = await inputHelper.getInputs()
if (sourceSettings.skipCleanup) {
return
}
try {
await gitSourceProvider.cleanup(stateHelper.RepositoryPath)
} catch (error) {