Skip to content

Commit

Permalink
refactor: refactor key referencing in warnUnsupportedRESTAPIInputs
Browse files Browse the repository at this point in the history
…function

- Change the way key is referenced in the `warnUnsupportedRESTAPIInputs` function in `utils.ts` to use `snakeCase` only at the point of warning message generation.
  • Loading branch information
jackton1 committed Jan 18, 2024
1 parent 78bbe66 commit 08316e3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1521,18 +1521,18 @@ export const warnUnsupportedRESTAPIInputs = async ({
inputs: Inputs
}): Promise<void> => {
for (const key of Object.keys(UNSUPPORTED_REST_API_INPUTS)) {
const inputKey = snakeCase(key) as keyof Inputs

const defaultValue = Object.hasOwnProperty.call(
UNSUPPORTED_REST_API_INPUTS,
inputKey
key
)
? UNSUPPORTED_REST_API_INPUTS[inputKey]?.toString()
? UNSUPPORTED_REST_API_INPUTS[key as keyof Inputs]?.toString()
: ''

if (defaultValue !== inputs[key as keyof Inputs]?.toString()) {
core.warning(
`Input "${inputKey}" is not supported when using GitHub's REST API to get changed files`
`Input "${snakeCase(
key
)}" is not supported when using GitHub's REST API to get changed files`
)
}
}
Expand Down

0 comments on commit 08316e3

Please sign in to comment.