3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2024-12-16 09:27:57 +00:00

rename: unsupported REST API inputs constant name (#1872)

This commit is contained in:
Tonye Jack 2024-01-17 20:39:20 -07:00 committed by GitHub
parent 6c9dcea443
commit cbd59070e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 5 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View file

@ -1,6 +1,6 @@
import {Inputs} from './inputs'
export const UNSUPPORTED_REST_API_INPUTS: Partial<Inputs> = {
export const DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS: Partial<Inputs> = {
sha: '',
baseSha: '',
since: '',

View file

@ -10,7 +10,7 @@ import {createInterface} from 'readline'
import {parseDocument} from 'yaml'
import {ChangedFiles, ChangeTypeEnum} from './changedFiles'
import {DiffResult} from './commitSha'
import {UNSUPPORTED_REST_API_INPUTS} from './constant'
import {DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS} from './constant'
import {Inputs} from './inputs'
const MINIMUM_GIT_VERSION = '2.18.0'
@ -1520,12 +1520,14 @@ export const warnUnsupportedRESTAPIInputs = async ({
}: {
inputs: Inputs
}): Promise<void> => {
for (const key of Object.keys(UNSUPPORTED_REST_API_INPUTS)) {
for (const key of Object.keys(DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS)) {
const defaultValue = Object.hasOwnProperty.call(
UNSUPPORTED_REST_API_INPUTS,
DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS,
key
)
? UNSUPPORTED_REST_API_INPUTS[key as keyof Inputs]?.toString()
? DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS[
key as keyof Inputs
]?.toString()
: ''
if (defaultValue !== inputs[key as keyof Inputs]?.toString()) {