Skip to content

Commit 2f018a8

Browse files
committed
check workflow dispatch
1 parent d45f139 commit 2f018a8

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@aws-sdk/client-cloudformation": "^3.533.0",
3636
"@aws-sdk/client-sts": "^3.533.0",
3737
"axios": "^1.6.7",
38+
"boolean": "^3.2.0",
3839
"jose": "^5.2.3"
3940
},
4041
"devDependencies": {
@@ -64,4 +65,4 @@
6465
"webpack-cli": "^4.9.1",
6566
"webpack-node-externals": "^3.0.0"
6667
}
67-
}
68+
}

src/action.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
GetCallerIdentityCommand,
1212
} from '@aws-sdk/client-sts';
1313
import { roleSetupInstructions } from './messages';
14+
import { boolean } from 'boolean';
1415

1516
const { GITHUB_REPOSITORY, GITHUB_REF, GITHUB_BASE_REF } = process.env;
1617

@@ -49,7 +50,11 @@ export class Action {
4950

5051
let deploy = true;
5152
let destroy = false;
52-
if (context.eventName === 'pull_request' && context.payload.action === 'closed') {
53+
if (
54+
(context.eventName === 'pull_request' && context.payload.action === 'closed') ||
55+
(context.eventName === 'workflow_dispatch' &&
56+
boolean(context.payload.inputs.destroy) === true)
57+
) {
5358
deploy = false;
5459
destroy = true;
5560
}

yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -1882,6 +1882,11 @@ before-after-hook@^2.2.0:
18821882
resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c"
18831883
integrity sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==
18841884

1885+
boolean@^3.2.0:
1886+
version "3.2.0"
1887+
resolved "https://registry.yarnpkg.com/boolean/-/boolean-3.2.0.tgz#9e5294af4e98314494cbb17979fa54ca159f116b"
1888+
integrity sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==
1889+
18851890
bowser@^2.11.0:
18861891
version "2.11.0"
18871892
resolved "https://registry.yarnpkg.com/bowser/-/bowser-2.11.0.tgz#5ca3c35757a7aa5771500c70a73a9f91ef420a8f"

0 commit comments

Comments
 (0)