mirror of
https://github.com/tj-actions/changed-files
synced 2024-12-17 03:47:20 +00:00
rename: unsupported REST API inputs constant name (#1872)
This commit is contained in:
parent
6c9dcea443
commit
cbd59070e8
4 changed files with 7 additions and 5 deletions
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
import {Inputs} from './inputs'
|
import {Inputs} from './inputs'
|
||||||
|
|
||||||
export const UNSUPPORTED_REST_API_INPUTS: Partial<Inputs> = {
|
export const DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS: Partial<Inputs> = {
|
||||||
sha: '',
|
sha: '',
|
||||||
baseSha: '',
|
baseSha: '',
|
||||||
since: '',
|
since: '',
|
||||||
|
|
10
src/utils.ts
10
src/utils.ts
|
@ -10,7 +10,7 @@ import {createInterface} from 'readline'
|
||||||
import {parseDocument} from 'yaml'
|
import {parseDocument} from 'yaml'
|
||||||
import {ChangedFiles, ChangeTypeEnum} from './changedFiles'
|
import {ChangedFiles, ChangeTypeEnum} from './changedFiles'
|
||||||
import {DiffResult} from './commitSha'
|
import {DiffResult} from './commitSha'
|
||||||
import {UNSUPPORTED_REST_API_INPUTS} from './constant'
|
import {DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS} from './constant'
|
||||||
import {Inputs} from './inputs'
|
import {Inputs} from './inputs'
|
||||||
|
|
||||||
const MINIMUM_GIT_VERSION = '2.18.0'
|
const MINIMUM_GIT_VERSION = '2.18.0'
|
||||||
|
@ -1520,12 +1520,14 @@ export const warnUnsupportedRESTAPIInputs = async ({
|
||||||
}: {
|
}: {
|
||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
}): Promise<void> => {
|
}): 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(
|
const defaultValue = Object.hasOwnProperty.call(
|
||||||
UNSUPPORTED_REST_API_INPUTS,
|
DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS,
|
||||||
key
|
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()) {
|
if (defaultValue !== inputs[key as keyof Inputs]?.toString()) {
|
||||||
|
|
Loading…
Reference in a new issue