Skip to content

Commit 3f0ed77

Browse files
committed
feat: dump input file type
1 parent 85e6a04 commit 3f0ed77

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

dist/index.js

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

src/run.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,20 @@ export const run = async (): Promise<void> => {
1313
const filePath = join(workspace, input.filePath)
1414
const fileName = input.gistFileName ?? basename(filePath)
1515

16+
const fileType = input.fileType === 'binary' ? 'binary' : 'text'
17+
1618
startGroup('Dump inputs')
1719
info(`\
1820
[INFO] GistId: ${input.gistId}${
1921
input.gistDescription === undefined ? '' : `\n[INFO] GistDescription: ${input.gistDescription}`
2022
}
2123
[INFO] GistFileName: ${fileName}
22-
[INFO] FilePath: ${input.filePath}`)
24+
[INFO] FilePath: ${input.filePath}
25+
[INFO] FileType: ${fileType}`)
2326
endGroup()
2427

2528
startGroup('Deploy to gist')
26-
if (input.fileType !== 'binary') {
29+
if (fileType === 'text') {
2730
const content = await fs.readFile(filePath, 'utf-8')
2831
const octokit = getOctokit(input.token)
2932
await octokit.rest.gists.update({

0 commit comments

Comments
 (0)