rename: unsupported REST API inputs constant name (#1872)
This commit is contained in:
parent
6c9dcea443
commit
cbd59070e8
10
dist/index.js
generated
vendored
10
dist/index.js
generated
vendored
@ -1358,8 +1358,8 @@ exports.getSHAForPullRequestEvent = getSHAForPullRequestEvent;
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.UNSUPPORTED_REST_API_INPUTS = void 0;
|
exports.DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS = void 0;
|
||||||
exports.UNSUPPORTED_REST_API_INPUTS = {
|
exports.DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS = {
|
||||||
sha: '',
|
sha: '',
|
||||||
baseSha: '',
|
baseSha: '',
|
||||||
since: '',
|
since: '',
|
||||||
@ -2956,9 +2956,9 @@ exports.hasLocalGitDirectory = hasLocalGitDirectory;
|
|||||||
*/
|
*/
|
||||||
const warnUnsupportedRESTAPIInputs = ({ inputs }) => __awaiter(void 0, void 0, void 0, function* () {
|
const warnUnsupportedRESTAPIInputs = ({ inputs }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
var _m, _o;
|
var _m, _o;
|
||||||
for (const key of Object.keys(constant_1.UNSUPPORTED_REST_API_INPUTS)) {
|
for (const key of Object.keys(constant_1.DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS)) {
|
||||||
const defaultValue = Object.hasOwnProperty.call(constant_1.UNSUPPORTED_REST_API_INPUTS, key)
|
const defaultValue = Object.hasOwnProperty.call(constant_1.DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS, key)
|
||||||
? (_m = constant_1.UNSUPPORTED_REST_API_INPUTS[key]) === null || _m === void 0 ? void 0 : _m.toString()
|
? (_m = constant_1.DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS[key]) === null || _m === void 0 ? void 0 : _m.toString()
|
||||||
: '';
|
: '';
|
||||||
if (defaultValue !== ((_o = inputs[key]) === null || _o === void 0 ? void 0 : _o.toString())) {
|
if (defaultValue !== ((_o = inputs[key]) === null || _o === void 0 ? void 0 : _o.toString())) {
|
||||||
core.warning(`Input "${(0, lodash_1.snakeCase)(key)}" is not supported when using GitHub's REST API to get changed files`);
|
core.warning(`Input "${(0, lodash_1.snakeCase)(key)}" is not supported when using GitHub's REST API to get changed files`);
|
||||||
|
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@ -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…
x
Reference in New Issue
Block a user