Skip to content

Commit 5fae61c

Browse files
committed
refactor: minor
1 parent bc4837c commit 5fae61c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function getInputFromEnv(
1010
name: string,
1111
options: { required?: boolean } = {}
1212
): string | undefined {
13-
const value = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`]
1413
const { required = false } = options
14+
const value = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`]
1515
if (required && !value) {
1616
throw new Error(`Input required and not supplied: ${name}`)
1717
}

src/run.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { promises as fs } from 'fs'
2-
import path from 'path'
2+
import { basename, join } from 'path'
33
import { startGroup, endGroup, info } from '@actions/core'
44
import { getOctokit } from '@actions/github'
55
import { getInput } from './input'
@@ -8,9 +8,9 @@ export const run = async (): Promise<void> => {
88
const input = getInput()
99

1010
const workSpace = process.env.GITHUB_WORKSPACE!
11-
const filePath = path.join(workSpace, input.filePath)
11+
const filePath = join(workSpace, input.filePath)
1212

13-
const fileName = input.gistFileName ?? path.basename(filePath)
13+
const fileName = input.gistFileName ?? basename(filePath)
1414

1515
startGroup('Dump inputs')
1616
info(`\

0 commit comments

Comments
 (0)