Skip to content

Commit 5b17c0b

Browse files
committed
fix: 🐛 detect post action
1 parent 85cb0ca commit 5b17c0b

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/action.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export namespace Action {
88
await Util.saveAppTokenToSecret(token)
99
core.setSecret(token)
1010
core.setOutput('token', token)
11-
core.info('Token generated successfully!')
11+
core.info('Token generated!')
1212
} catch (e) {
1313
core.error(e)
1414
core.setFailed(e.message)
@@ -18,6 +18,7 @@ export namespace Action {
1818
export async function cleanup() {
1919
try {
2020
await Util.removeAppTokenFromSecret()
21+
core.info('Token cleaned!')
2122
} catch (e) {
2223
core.error(e)
2324
core.setFailed(e.message)

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { State } from './state'
22
import { Action } from './action'
33

4-
if (!State.isPost()) {
4+
if (!State.isPost) {
55
Action.run()
66
} else {
77
Action.cleanup()

src/state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as coreCommand from '@actions/core/lib/command'
22

33
export namespace State {
4-
export const isPost = () => !!process.env['STATE_isPost']
4+
export const isPost = !!process.env['STATE_isPost']
55

66
// Publish a variable so that when the POST action runs, it can determine
77
// it should run the cleanup logic. This is necessary since we don't have

0 commit comments

Comments
 (0)