Skip to content

Commit 5906069

Browse files
committed
destroy output
1 parent 675c800 commit 5906069

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

action.yml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ inputs:
1414
outputs:
1515
stage:
1616
description: The inferred stage from the branch or PR name
17+
destroy:
18+
description: If the serverless stack should be destroyed, defaults to false. True when a pull request is closed.
1719
runs:
1820
using: 'node20'
1921
main: 'dist/main.js'

src/action.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,14 @@ export class Action {
4545
}
4646
deploymentStage = `${GITHUB_BASE_REF}-pr-${branchId}`;
4747
}
48-
4948
setOutput('stage', deploymentStage);
5049

50+
let destroy = false;
51+
if (context.eventName === 'pull_request' && context.payload.action === 'closed') {
52+
destroy = true;
53+
}
54+
setOutput('destroy', destroy);
55+
5156
let idToken: string | undefined = undefined;
5257

5358
try {

0 commit comments

Comments
 (0)