Skip to content

Commit 1f66769

Browse files
committed
fix: inputs are not showed as expected
1 parent 7c5d832 commit 1f66769

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

__tests__/index.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ test('run', () => {
2727
process.env.INPUT_FILE_PATH = '__tests__/foo.bar'
2828

2929
const filePath = path.join(__dirname, '../lib/index.js')
30-
execSync(`node ${filePath}`, { env: process.env })
30+
const stdoutBuffer = execSync(`node ${filePath}`, { env: process.env })
31+
console.log(stdoutBuffer.toString())
3132
})

dist/index.js

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/input.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { getInput as getActionInput } from '@actions/core'
33
type Input = Readonly<{
44
token: string
55
gistId: string
6-
gistDescription?: string
7-
gistFileName?: string
6+
gistDescription: string
7+
gistFileName: string
88
filePath: string
99
}>
1010

src/run.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ export const run = async (): Promise<void> => {
99

1010
const workSpace = process.env.GITHUB_WORKSPACE!
1111
const filePath = path.join(workSpace, input.filePath)
12-
const fileName = input.gistFileName ?? path.basename(filePath)
12+
const fileName =
13+
input.gistFileName.length === 0
14+
? path.basename(filePath)
15+
: input.gistFileName
1316

1417
startGroup('Dump inputs')
1518
info(`\
1619
[INFO] GistId: ${input.gistId}${
17-
input.gistDescription === undefined
20+
input.gistDescription.length === 0
1821
? ''
1922
: `\n[INFO] GistDescription: ${input.gistDescription}`
2023
}

0 commit comments

Comments
 (0)