mirror of
https://github.com/tj-actions/changed-files
synced 2025-02-21 05:28:14 +00:00
rename: unsupported REST API inputs constant name (#1872)
This commit is contained in:
parent
6c9dcea443
commit
cbd59070e8
4 changed files with 13 additions and 11 deletions
10
dist/index.js
generated
vendored
10
dist/index.js
generated
vendored
|
@ -1358,8 +1358,8 @@ exports.getSHAForPullRequestEvent = getSHAForPullRequestEvent;
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.UNSUPPORTED_REST_API_INPUTS = void 0;
|
||||
exports.UNSUPPORTED_REST_API_INPUTS = {
|
||||
exports.DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS = void 0;
|
||||
exports.DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS = {
|
||||
sha: '',
|
||||
baseSha: '',
|
||||
since: '',
|
||||
|
@ -2956,9 +2956,9 @@ exports.hasLocalGitDirectory = hasLocalGitDirectory;
|
|||
*/
|
||||
const warnUnsupportedRESTAPIInputs = ({ inputs }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
var _m, _o;
|
||||
for (const key of Object.keys(constant_1.UNSUPPORTED_REST_API_INPUTS)) {
|
||||
const defaultValue = Object.hasOwnProperty.call(constant_1.UNSUPPORTED_REST_API_INPUTS, key)
|
||||
? (_m = constant_1.UNSUPPORTED_REST_API_INPUTS[key]) === null || _m === void 0 ? void 0 : _m.toString()
|
||||
for (const key of Object.keys(constant_1.DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS)) {
|
||||
const defaultValue = Object.hasOwnProperty.call(constant_1.DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS, key)
|
||||
? (_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())) {
|
||||
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'
|
||||
|
||||
export const UNSUPPORTED_REST_API_INPUTS: Partial<Inputs> = {
|
||||
export const DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS: Partial<Inputs> = {
|
||||
sha: '',
|
||||
baseSha: '',
|
||||
since: '',
|
||||
|
|
10
src/utils.ts
10
src/utils.ts
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue