Skip to content

Commit e7667ab

Browse files
committed
feat(inputs): add option to disable the post action
1 parent 8edcb1b commit e7667ab

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ inputs:
9898
github-server-url:
9999
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
100100
required: false
101+
skip-cleanup:
102+
description: Skips the cleanup phase on post action hook
103+
required: false
104+
default: false
101105
outputs:
102106
ref:
103107
description: 'The branch, tag or SHA that was checked out'

src/git-source-settings.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,9 @@ export interface IGitSourceSettings {
118118
* User override on the GitHub Server/Host URL that hosts the repository to be cloned
119119
*/
120120
githubServerUrl: string | undefined
121+
122+
/**
123+
* Disable the post action cleanup phase
124+
*/
125+
skipCleanup: boolean
121126
}

src/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ async function run(): Promise<void> {
3030
}
3131

3232
async function cleanup(): Promise<void> {
33+
const sourceSettings = await inputHelper.getInputs()
34+
35+
if (sourceSettings.skipCleanup) {
36+
return
37+
}
38+
3339
try {
3440
await gitSourceProvider.cleanup(stateHelper.RepositoryPath)
3541
} catch (error) {

0 commit comments

Comments
 (0)