Added missing changes and modified dist assets.
This commit is contained in:
parent
8293f8c984
commit
ea042d8095
180
dist/index.js
generated
vendored
180
dist/index.js
generated
vendored
@ -57,7 +57,7 @@ const micromatch_1 = __importDefault(__nccwpck_require__(6228));
|
|||||||
const path = __importStar(__nccwpck_require__(1017));
|
const path = __importStar(__nccwpck_require__(1017));
|
||||||
const changedFilesOutput_1 = __nccwpck_require__(8930);
|
const changedFilesOutput_1 = __nccwpck_require__(8930);
|
||||||
const utils_1 = __nccwpck_require__(918);
|
const utils_1 = __nccwpck_require__(918);
|
||||||
const processChangedFiles = ({ filePatterns, allDiffFiles, inputs, yamlFilePatterns, workingDirectory }) => __awaiter(void 0, void 0, void 0, function* () {
|
const processChangedFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ filePatterns, allDiffFiles, inputs, yamlFilePatterns, workingDirectory }) {
|
||||||
if (filePatterns.length > 0) {
|
if (filePatterns.length > 0) {
|
||||||
core.startGroup('changed-files-patterns');
|
core.startGroup('changed-files-patterns');
|
||||||
const allFilteredDiffFiles = yield (0, utils_1.getFilteredChangedFiles)({
|
const allFilteredDiffFiles = yield (0, utils_1.getFilteredChangedFiles)({
|
||||||
@ -130,7 +130,7 @@ const processChangedFiles = ({ filePatterns, allDiffFiles, inputs, yamlFilePatte
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
exports.processChangedFiles = processChangedFiles;
|
exports.processChangedFiles = processChangedFiles;
|
||||||
const getRenamedFiles = ({ inputs, workingDirectory, hasSubmodule, diffResult, submodulePaths }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getRenamedFiles = (_b) => __awaiter(void 0, [_b], void 0, function* ({ inputs, workingDirectory, hasSubmodule, diffResult, submodulePaths }) {
|
||||||
const renamedFiles = yield (0, utils_1.gitRenamedFiles)({
|
const renamedFiles = yield (0, utils_1.gitRenamedFiles)({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
sha1: diffResult.previousSha,
|
sha1: diffResult.previousSha,
|
||||||
@ -199,7 +199,7 @@ var ChangeTypeEnum;
|
|||||||
ChangeTypeEnum["Unmerged"] = "U";
|
ChangeTypeEnum["Unmerged"] = "U";
|
||||||
ChangeTypeEnum["Unknown"] = "X";
|
ChangeTypeEnum["Unknown"] = "X";
|
||||||
})(ChangeTypeEnum || (exports.ChangeTypeEnum = ChangeTypeEnum = {}));
|
})(ChangeTypeEnum || (exports.ChangeTypeEnum = ChangeTypeEnum = {}));
|
||||||
const getAllDiffFiles = ({ workingDirectory, hasSubmodule, diffResult, submodulePaths, outputRenamedFilesAsDeletedAndAdded, fetchAdditionalSubmoduleHistory, failOnInitialDiffError, failOnSubmoduleDiffError }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getAllDiffFiles = (_c) => __awaiter(void 0, [_c], void 0, function* ({ workingDirectory, hasSubmodule, diffResult, submodulePaths, outputRenamedFilesAsDeletedAndAdded, fetchAdditionalSubmoduleHistory, failOnInitialDiffError, failOnSubmoduleDiffError }) {
|
||||||
const files = yield (0, utils_1.getAllChangedFiles)({
|
const files = yield (0, utils_1.getAllChangedFiles)({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
sha1: diffResult.previousSha,
|
sha1: diffResult.previousSha,
|
||||||
@ -290,7 +290,7 @@ function* getChangeTypeFilesGenerator({ inputs, changedFiles, changeTypes }) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const getChangeTypeFiles = ({ inputs, changedFiles, changeTypes }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getChangeTypeFiles = (_d) => __awaiter(void 0, [_d], void 0, function* ({ inputs, changedFiles, changeTypes }) {
|
||||||
const files = [
|
const files = [
|
||||||
...new Set(getChangeTypeFilesGenerator({ inputs, changedFiles, changeTypes }))
|
...new Set(getChangeTypeFilesGenerator({ inputs, changedFiles, changeTypes }))
|
||||||
].filter(Boolean);
|
].filter(Boolean);
|
||||||
@ -313,7 +313,7 @@ function* getAllChangeTypeFilesGenerator({ inputs, changedFiles }) {
|
|||||||
yield filePath;
|
yield filePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const getAllChangeTypeFiles = ({ inputs, changedFiles }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getAllChangeTypeFiles = (_e) => __awaiter(void 0, [_e], void 0, function* ({ inputs, changedFiles }) {
|
||||||
const files = [
|
const files = [
|
||||||
...new Set(getAllChangeTypeFilesGenerator({ inputs, changedFiles }))
|
...new Set(getAllChangeTypeFilesGenerator({ inputs, changedFiles }))
|
||||||
].filter(Boolean);
|
].filter(Boolean);
|
||||||
@ -324,9 +324,9 @@ const getAllChangeTypeFiles = ({ inputs, changedFiles }) => __awaiter(void 0, vo
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
exports.getAllChangeTypeFiles = getAllChangeTypeFiles;
|
exports.getAllChangeTypeFiles = getAllChangeTypeFiles;
|
||||||
const getChangedFilesFromGithubAPI = ({ inputs }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getChangedFilesFromGithubAPI = (_f) => __awaiter(void 0, [_f], void 0, function* ({ inputs }) {
|
||||||
var _a, e_1, _b, _c;
|
var _g, e_1, _h, _j;
|
||||||
var _d;
|
var _k;
|
||||||
const octokit = github.getOctokit(inputs.token, {
|
const octokit = github.getOctokit(inputs.token, {
|
||||||
baseUrl: inputs.apiUrl
|
baseUrl: inputs.apiUrl
|
||||||
});
|
});
|
||||||
@ -344,7 +344,7 @@ const getChangedFilesFromGithubAPI = ({ inputs }) => __awaiter(void 0, void 0, v
|
|||||||
const options = octokit.rest.pulls.listFiles.endpoint.merge({
|
const options = octokit.rest.pulls.listFiles.endpoint.merge({
|
||||||
owner: github.context.repo.owner,
|
owner: github.context.repo.owner,
|
||||||
repo: github.context.repo.repo,
|
repo: github.context.repo.repo,
|
||||||
pull_number: (_d = github.context.payload.pull_request) === null || _d === void 0 ? void 0 : _d.number,
|
pull_number: (_k = github.context.payload.pull_request) === null || _k === void 0 ? void 0 : _k.number,
|
||||||
per_page: 100
|
per_page: 100
|
||||||
});
|
});
|
||||||
const paginatedResponse = yield octokit.paginate(options);
|
const paginatedResponse = yield octokit.paginate(options);
|
||||||
@ -359,10 +359,10 @@ const getChangedFilesFromGithubAPI = ({ inputs }) => __awaiter(void 0, void 0, v
|
|||||||
unchanged: ChangeTypeEnum.Unmerged
|
unchanged: ChangeTypeEnum.Unmerged
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
for (var _e = true, paginatedResponse_1 = __asyncValues(paginatedResponse), paginatedResponse_1_1; paginatedResponse_1_1 = yield paginatedResponse_1.next(), _a = paginatedResponse_1_1.done, !_a; _e = true) {
|
for (var _l = true, paginatedResponse_1 = __asyncValues(paginatedResponse), paginatedResponse_1_1; paginatedResponse_1_1 = yield paginatedResponse_1.next(), _g = paginatedResponse_1_1.done, !_g; _l = true) {
|
||||||
_c = paginatedResponse_1_1.value;
|
_j = paginatedResponse_1_1.value;
|
||||||
_e = false;
|
_l = false;
|
||||||
const item = _c;
|
const item = _j;
|
||||||
const changeType = statusMap[item.status] || ChangeTypeEnum.Unknown;
|
const changeType = statusMap[item.status] || ChangeTypeEnum.Unknown;
|
||||||
if (changeType === ChangeTypeEnum.Renamed) {
|
if (changeType === ChangeTypeEnum.Renamed) {
|
||||||
if (inputs.outputRenamedFilesAsDeletedAndAdded) {
|
if (inputs.outputRenamedFilesAsDeletedAndAdded) {
|
||||||
@ -381,7 +381,7 @@ const getChangedFilesFromGithubAPI = ({ inputs }) => __awaiter(void 0, void 0, v
|
|||||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||||
finally {
|
finally {
|
||||||
try {
|
try {
|
||||||
if (!_e && !_a && (_b = paginatedResponse_1.return)) yield _b.call(paginatedResponse_1);
|
if (!_l && !_g && (_h = paginatedResponse_1.return)) yield _h.call(paginatedResponse_1);
|
||||||
}
|
}
|
||||||
finally { if (e_1) throw e_1.error; }
|
finally { if (e_1) throw e_1.error; }
|
||||||
}
|
}
|
||||||
@ -441,7 +441,7 @@ const utils_1 = __nccwpck_require__(918);
|
|||||||
const getArrayFromPaths = (paths, inputs) => {
|
const getArrayFromPaths = (paths, inputs) => {
|
||||||
return Array.isArray(paths) ? paths : paths.split(inputs.separator);
|
return Array.isArray(paths) ? paths : paths.split(inputs.separator);
|
||||||
};
|
};
|
||||||
const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilteredDiffFiles, inputs, filePatterns = [], outputPrefix = '', workingDirectory }) => __awaiter(void 0, void 0, void 0, function* () {
|
const setOutputsAndGetModifiedAndChangedFilesStatus = (_a) => __awaiter(void 0, [_a], void 0, function* ({ allDiffFiles, allFilteredDiffFiles, inputs, filePatterns = [], outputPrefix = '', workingDirectory }) {
|
||||||
const addedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
|
const addedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
|
||||||
inputs,
|
inputs,
|
||||||
changedFiles: allFilteredDiffFiles,
|
changedFiles: allFilteredDiffFiles,
|
||||||
@ -876,8 +876,8 @@ exports.getSHAForPullRequestEvent = exports.getSHAForNonPullRequestEvent = void
|
|||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const github = __importStar(__nccwpck_require__(5438));
|
const github = __importStar(__nccwpck_require__(5438));
|
||||||
const utils_1 = __nccwpck_require__(918);
|
const utils_1 = __nccwpck_require__(918);
|
||||||
const getCurrentSHA = ({ inputs, workingDirectory }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getCurrentSHA = (_a) => __awaiter(void 0, [_a], void 0, function* ({ inputs, workingDirectory }) {
|
||||||
var _a, _b, _c, _d, _e, _f, _g;
|
var _b, _c, _d, _e, _f, _g, _h;
|
||||||
let currentSha = yield (0, utils_1.cleanShaInput)({
|
let currentSha = yield (0, utils_1.cleanShaInput)({
|
||||||
sha: inputs.sha,
|
sha: inputs.sha,
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
@ -907,16 +907,16 @@ const getCurrentSHA = ({ inputs, workingDirectory }) => __awaiter(void 0, void 0
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!currentSha) {
|
if (!currentSha) {
|
||||||
if (((_b = (_a = github.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.head) === null || _b === void 0 ? void 0 : _b.sha) &&
|
if (((_c = (_b = github.context.payload.pull_request) === null || _b === void 0 ? void 0 : _b.head) === null || _c === void 0 ? void 0 : _c.sha) &&
|
||||||
(yield (0, utils_1.verifyCommitSha)({
|
(yield (0, utils_1.verifyCommitSha)({
|
||||||
sha: (_d = (_c = github.context.payload.pull_request) === null || _c === void 0 ? void 0 : _c.head) === null || _d === void 0 ? void 0 : _d.sha,
|
sha: (_e = (_d = github.context.payload.pull_request) === null || _d === void 0 ? void 0 : _d.head) === null || _e === void 0 ? void 0 : _e.sha,
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
showAsErrorMessage: false
|
showAsErrorMessage: false
|
||||||
})) === 0) {
|
})) === 0) {
|
||||||
currentSha = (_f = (_e = github.context.payload.pull_request) === null || _e === void 0 ? void 0 : _e.head) === null || _f === void 0 ? void 0 : _f.sha;
|
currentSha = (_g = (_f = github.context.payload.pull_request) === null || _f === void 0 ? void 0 : _f.head) === null || _g === void 0 ? void 0 : _g.sha;
|
||||||
}
|
}
|
||||||
else if (github.context.eventName === 'merge_group') {
|
else if (github.context.eventName === 'merge_group') {
|
||||||
currentSha = (_g = github.context.payload.merge_group) === null || _g === void 0 ? void 0 : _g.head_sha;
|
currentSha = (_h = github.context.payload.merge_group) === null || _h === void 0 ? void 0 : _h.head_sha;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
currentSha = yield (0, utils_1.getHeadSha)({ cwd: workingDirectory });
|
currentSha = yield (0, utils_1.getHeadSha)({ cwd: workingDirectory });
|
||||||
@ -928,7 +928,7 @@ const getCurrentSHA = ({ inputs, workingDirectory }) => __awaiter(void 0, void 0
|
|||||||
return currentSha;
|
return currentSha;
|
||||||
});
|
});
|
||||||
const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow, hasSubmodule, gitFetchExtraArgs, isTag) => __awaiter(void 0, void 0, void 0, function* () {
|
const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow, hasSubmodule, gitFetchExtraArgs, isTag) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
var _h, _j, _k;
|
var _j, _k, _l;
|
||||||
let targetBranch = env.GITHUB_REF_NAME;
|
let targetBranch = env.GITHUB_REF_NAME;
|
||||||
let currentBranch = targetBranch;
|
let currentBranch = targetBranch;
|
||||||
let initialCommit = false;
|
let initialCommit = false;
|
||||||
@ -940,8 +940,8 @@ const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow,
|
|||||||
if (github.context.payload.base_ref) {
|
if (github.context.payload.base_ref) {
|
||||||
sourceBranch = github.context.payload.base_ref.replace('refs/heads/', '');
|
sourceBranch = github.context.payload.base_ref.replace('refs/heads/', '');
|
||||||
}
|
}
|
||||||
else if ((_h = github.context.payload.release) === null || _h === void 0 ? void 0 : _h.target_commitish) {
|
else if ((_j = github.context.payload.release) === null || _j === void 0 ? void 0 : _j.target_commitish) {
|
||||||
sourceBranch = (_j = github.context.payload.release) === null || _j === void 0 ? void 0 : _j.target_commitish;
|
sourceBranch = (_k = github.context.payload.release) === null || _k === void 0 ? void 0 : _k.target_commitish;
|
||||||
}
|
}
|
||||||
yield (0, utils_1.gitFetch)({
|
yield (0, utils_1.gitFetch)({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
@ -1051,7 +1051,7 @@ const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow,
|
|||||||
else {
|
else {
|
||||||
if (github.context.eventName === 'merge_group') {
|
if (github.context.eventName === 'merge_group') {
|
||||||
core.debug('Getting previous SHA for merge group...');
|
core.debug('Getting previous SHA for merge group...');
|
||||||
previousSha = (_k = github.context.payload.merge_group) === null || _k === void 0 ? void 0 : _k.base_sha;
|
previousSha = (_l = github.context.payload.merge_group) === null || _l === void 0 ? void 0 : _l.base_sha;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.debug('Getting previous SHA for last remote commit...');
|
core.debug('Getting previous SHA for last remote commit...');
|
||||||
@ -1108,9 +1108,9 @@ const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow,
|
|||||||
});
|
});
|
||||||
exports.getSHAForNonPullRequestEvent = getSHAForNonPullRequestEvent;
|
exports.getSHAForNonPullRequestEvent = getSHAForNonPullRequestEvent;
|
||||||
const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, hasSubmodule, gitFetchExtraArgs) => __awaiter(void 0, void 0, void 0, function* () {
|
const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, hasSubmodule, gitFetchExtraArgs) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
var _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
var _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
||||||
let targetBranch = (_m = (_l = github.context.payload.pull_request) === null || _l === void 0 ? void 0 : _l.base) === null || _m === void 0 ? void 0 : _m.ref;
|
let targetBranch = (_o = (_m = github.context.payload.pull_request) === null || _m === void 0 ? void 0 : _m.base) === null || _o === void 0 ? void 0 : _o.ref;
|
||||||
const currentBranch = (_p = (_o = github.context.payload.pull_request) === null || _o === void 0 ? void 0 : _o.head) === null || _p === void 0 ? void 0 : _p.ref;
|
const currentBranch = (_q = (_p = github.context.payload.pull_request) === null || _p === void 0 ? void 0 : _p.head) === null || _q === void 0 ? void 0 : _q.ref;
|
||||||
if (inputs.sinceLastRemoteCommit) {
|
if (inputs.sinceLastRemoteCommit) {
|
||||||
targetBranch = currentBranch;
|
targetBranch = currentBranch;
|
||||||
}
|
}
|
||||||
@ -1124,7 +1124,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
|||||||
'-u',
|
'-u',
|
||||||
'--progress',
|
'--progress',
|
||||||
'origin',
|
'origin',
|
||||||
`pull/${(_q = github.context.payload.pull_request) === null || _q === void 0 ? void 0 : _q.number}/head:${currentBranch}`
|
`pull/${(_r = github.context.payload.pull_request) === null || _r === void 0 ? void 0 : _r.number}/head:${currentBranch}`
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
if (prFetchExitCode !== 0) {
|
if (prFetchExitCode !== 0) {
|
||||||
@ -1206,8 +1206,8 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
|||||||
diff
|
diff
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (!((_s = (_r = github.context.payload.pull_request) === null || _r === void 0 ? void 0 : _r.base) === null || _s === void 0 ? void 0 : _s.ref) ||
|
if (!((_t = (_s = github.context.payload.pull_request) === null || _s === void 0 ? void 0 : _s.base) === null || _t === void 0 ? void 0 : _t.ref) ||
|
||||||
((_v = (_u = (_t = github.context.payload.pull_request) === null || _t === void 0 ? void 0 : _t.head) === null || _u === void 0 ? void 0 : _u.repo) === null || _v === void 0 ? void 0 : _v.fork) === true) {
|
((_w = (_v = (_u = github.context.payload.pull_request) === null || _u === void 0 ? void 0 : _u.head) === null || _v === void 0 ? void 0 : _v.repo) === null || _w === void 0 ? void 0 : _w.fork) === true) {
|
||||||
diff = '..';
|
diff = '..';
|
||||||
}
|
}
|
||||||
if (!previousSha || previousSha === currentSha) {
|
if (!previousSha || previousSha === currentSha) {
|
||||||
@ -1249,7 +1249,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (github.context.payload.action === 'closed') {
|
if (github.context.payload.action === 'closed') {
|
||||||
previousSha = (_x = (_w = github.context.payload.pull_request) === null || _w === void 0 ? void 0 : _w.base) === null || _x === void 0 ? void 0 : _x.sha;
|
previousSha = (_y = (_x = github.context.payload.pull_request) === null || _x === void 0 ? void 0 : _x.base) === null || _y === void 0 ? void 0 : _y.sha;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
previousSha = yield (0, utils_1.getRemoteBranchHeadSha)({
|
previousSha = yield (0, utils_1.getRemoteBranchHeadSha)({
|
||||||
@ -1257,7 +1257,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
|||||||
branch: targetBranch
|
branch: targetBranch
|
||||||
});
|
});
|
||||||
if (!previousSha) {
|
if (!previousSha) {
|
||||||
previousSha = (_z = (_y = github.context.payload.pull_request) === null || _y === void 0 ? void 0 : _y.base) === null || _z === void 0 ? void 0 : _z.sha;
|
previousSha = (_0 = (_z = github.context.payload.pull_request) === null || _z === void 0 ? void 0 : _z.base) === null || _0 === void 0 ? void 0 : _0.sha;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isShallow) {
|
if (isShallow) {
|
||||||
@ -1295,7 +1295,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!previousSha || previousSha === currentSha) {
|
if (!previousSha || previousSha === currentSha) {
|
||||||
previousSha = (_1 = (_0 = github.context.payload.pull_request) === null || _0 === void 0 ? void 0 : _0.base) === null || _1 === void 0 ? void 0 : _1.sha;
|
previousSha = (_2 = (_1 = github.context.payload.pull_request) === null || _1 === void 0 ? void 0 : _1.base) === null || _2 === void 0 ? void 0 : _2.sha;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!(yield (0, utils_1.canDiffCommits)({
|
if (!(yield (0, utils_1.canDiffCommits)({
|
||||||
@ -1707,8 +1707,8 @@ const commitSha_1 = __nccwpck_require__(8613);
|
|||||||
const env_1 = __nccwpck_require__(9763);
|
const env_1 = __nccwpck_require__(9763);
|
||||||
const inputs_1 = __nccwpck_require__(6180);
|
const inputs_1 = __nccwpck_require__(6180);
|
||||||
const utils_1 = __nccwpck_require__(918);
|
const utils_1 = __nccwpck_require__(918);
|
||||||
const getChangedFilesFromLocalGitHistory = ({ inputs, env, workingDirectory, filePatterns, yamlFilePatterns }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getChangedFilesFromLocalGitHistory = (_a) => __awaiter(void 0, [_a], void 0, function* ({ inputs, env, workingDirectory, filePatterns, yamlFilePatterns }) {
|
||||||
var _a, _b, _c;
|
var _b, _c, _d;
|
||||||
yield (0, utils_1.verifyMinimumGitVersion)();
|
yield (0, utils_1.verifyMinimumGitVersion)();
|
||||||
let quotepathValue = 'on';
|
let quotepathValue = 'on';
|
||||||
if (!inputs.quotepath) {
|
if (!inputs.quotepath) {
|
||||||
@ -1727,7 +1727,7 @@ const getChangedFilesFromLocalGitHistory = ({ inputs, env, workingDirectory, fil
|
|||||||
const isShallow = yield (0, utils_1.isRepoShallow)({ cwd: workingDirectory });
|
const isShallow = yield (0, utils_1.isRepoShallow)({ cwd: workingDirectory });
|
||||||
const hasSubmodule = yield (0, utils_1.submoduleExists)({ cwd: workingDirectory });
|
const hasSubmodule = yield (0, utils_1.submoduleExists)({ cwd: workingDirectory });
|
||||||
let gitFetchExtraArgs = ['--no-tags', '--prune', '--recurse-submodules'];
|
let gitFetchExtraArgs = ['--no-tags', '--prune', '--recurse-submodules'];
|
||||||
const isTag = (_a = env.GITHUB_REF) === null || _a === void 0 ? void 0 : _a.startsWith('refs/tags/');
|
const isTag = (_b = env.GITHUB_REF) === null || _b === void 0 ? void 0 : _b.startsWith('refs/tags/');
|
||||||
const outputRenamedFilesAsDeletedAndAdded = inputs.outputRenamedFilesAsDeletedAndAdded;
|
const outputRenamedFilesAsDeletedAndAdded = inputs.outputRenamedFilesAsDeletedAndAdded;
|
||||||
let submodulePaths = [];
|
let submodulePaths = [];
|
||||||
if (hasSubmodule) {
|
if (hasSubmodule) {
|
||||||
@ -1737,7 +1737,7 @@ const getChangedFilesFromLocalGitHistory = ({ inputs, env, workingDirectory, fil
|
|||||||
gitFetchExtraArgs = ['--prune', '--no-recurse-submodules'];
|
gitFetchExtraArgs = ['--prune', '--no-recurse-submodules'];
|
||||||
}
|
}
|
||||||
let diffResult;
|
let diffResult;
|
||||||
if (!((_c = (_b = github.context.payload.pull_request) === null || _b === void 0 ? void 0 : _b.base) === null || _c === void 0 ? void 0 : _c.ref)) {
|
if (!((_d = (_c = github.context.payload.pull_request) === null || _c === void 0 ? void 0 : _c.base) === null || _d === void 0 ? void 0 : _d.ref)) {
|
||||||
core.info(`Running on a ${github.context.eventName || 'push'} event...`);
|
core.info(`Running on a ${github.context.eventName || 'push'} event...`);
|
||||||
diffResult = yield (0, commitSha_1.getSHAForNonPullRequestEvent)(inputs, env, workingDirectory, isShallow, hasSubmodule, gitFetchExtraArgs, isTag);
|
diffResult = yield (0, commitSha_1.getSHAForNonPullRequestEvent)(inputs, env, workingDirectory, isShallow, hasSubmodule, gitFetchExtraArgs, isTag);
|
||||||
}
|
}
|
||||||
@ -1816,7 +1816,7 @@ const getChangedFilesFromLocalGitHistory = ({ inputs, env, workingDirectory, fil
|
|||||||
core.endGroup();
|
core.endGroup();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const getChangedFilesFromRESTAPI = ({ inputs, filePatterns, yamlFilePatterns }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getChangedFilesFromRESTAPI = (_e) => __awaiter(void 0, [_e], void 0, function* ({ inputs, filePatterns, yamlFilePatterns }) {
|
||||||
const allDiffFiles = yield (0, changedFiles_1.getChangedFilesFromGithubAPI)({
|
const allDiffFiles = yield (0, changedFiles_1.getChangedFilesFromGithubAPI)({
|
||||||
inputs
|
inputs
|
||||||
});
|
});
|
||||||
@ -1830,8 +1830,8 @@ const getChangedFilesFromRESTAPI = ({ inputs, filePatterns, yamlFilePatterns })
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
function run() {
|
function run() {
|
||||||
var _a, _b;
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
var _a, _b;
|
||||||
core.startGroup('changed-files');
|
core.startGroup('changed-files');
|
||||||
const env = yield (0, env_1.getEnv)();
|
const env = yield (0, env_1.getEnv)();
|
||||||
core.debug(`Env: ${JSON.stringify(env, null, 2)}`);
|
core.debug(`Env: ${JSON.stringify(env, null, 2)}`);
|
||||||
@ -2088,9 +2088,9 @@ exports.exists = exists;
|
|||||||
* @param filePath - path of file to read
|
* @param filePath - path of file to read
|
||||||
* @param excludedFiles - whether to exclude files
|
* @param excludedFiles - whether to exclude files
|
||||||
*/
|
*/
|
||||||
function lineOfFileGenerator({ filePath, excludedFiles }) {
|
function lineOfFileGenerator(_a) {
|
||||||
return __asyncGenerator(this, arguments, function* lineOfFileGenerator_1() {
|
return __asyncGenerator(this, arguments, function* lineOfFileGenerator_1({ filePath, excludedFiles }) {
|
||||||
var _a, e_1, _b, _c;
|
var _b, e_1, _c, _d;
|
||||||
const fileStream = (0, fs_1.createReadStream)(filePath);
|
const fileStream = (0, fs_1.createReadStream)(filePath);
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
fileStream.on('error', error => {
|
fileStream.on('error', error => {
|
||||||
@ -2101,10 +2101,10 @@ function lineOfFileGenerator({ filePath, excludedFiles }) {
|
|||||||
crlfDelay: Infinity
|
crlfDelay: Infinity
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
for (var _d = true, rl_1 = __asyncValues(rl), rl_1_1; rl_1_1 = yield __await(rl_1.next()), _a = rl_1_1.done, !_a; _d = true) {
|
for (var _e = true, rl_1 = __asyncValues(rl), rl_1_1; rl_1_1 = yield __await(rl_1.next()), _b = rl_1_1.done, !_b; _e = true) {
|
||||||
_c = rl_1_1.value;
|
_d = rl_1_1.value;
|
||||||
_d = false;
|
_e = false;
|
||||||
let line = _c;
|
let line = _d;
|
||||||
if (!line.startsWith('#') && line !== '') {
|
if (!line.startsWith('#') && line !== '') {
|
||||||
if (excludedFiles) {
|
if (excludedFiles) {
|
||||||
line = line.startsWith('!') ? line : `!${line}`;
|
line = line.startsWith('!') ? line : `!${line}`;
|
||||||
@ -2123,7 +2123,7 @@ function lineOfFileGenerator({ filePath, excludedFiles }) {
|
|||||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||||
finally {
|
finally {
|
||||||
try {
|
try {
|
||||||
if (!_d && !_a && (_b = rl_1.return)) yield __await(_b.call(rl_1));
|
if (!_e && !_b && (_c = rl_1.return)) yield __await(_c.call(rl_1));
|
||||||
}
|
}
|
||||||
finally { if (e_1) throw e_1.error; }
|
finally { if (e_1) throw e_1.error; }
|
||||||
}
|
}
|
||||||
@ -2134,22 +2134,22 @@ function lineOfFileGenerator({ filePath, excludedFiles }) {
|
|||||||
* @param filePaths - paths of files to read
|
* @param filePaths - paths of files to read
|
||||||
* @param excludedFiles - whether to exclude the file patterns
|
* @param excludedFiles - whether to exclude the file patterns
|
||||||
*/
|
*/
|
||||||
const getFilesFromSourceFile = ({ filePaths, excludedFiles = false }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getFilesFromSourceFile = (_b) => __awaiter(void 0, [_b], void 0, function* ({ filePaths, excludedFiles = false }) {
|
||||||
var _b, e_2, _c, _d;
|
var _c, e_2, _d, _e;
|
||||||
const lines = [];
|
const lines = [];
|
||||||
for (const filePath of filePaths) {
|
for (const filePath of filePaths) {
|
||||||
try {
|
try {
|
||||||
for (var _e = true, _f = (e_2 = void 0, __asyncValues(lineOfFileGenerator({ filePath, excludedFiles }))), _g; _g = yield _f.next(), _b = _g.done, !_b; _e = true) {
|
for (var _f = true, _g = (e_2 = void 0, __asyncValues(lineOfFileGenerator({ filePath, excludedFiles }))), _h; _h = yield _g.next(), _c = _h.done, !_c; _f = true) {
|
||||||
_d = _g.value;
|
_e = _h.value;
|
||||||
_e = false;
|
_f = false;
|
||||||
const line = _d;
|
const line = _e;
|
||||||
lines.push(line);
|
lines.push(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||||
finally {
|
finally {
|
||||||
try {
|
try {
|
||||||
if (!_e && !_b && (_c = _f.return)) yield _c.call(_f);
|
if (!_f && !_c && (_d = _g.return)) yield _d.call(_g);
|
||||||
}
|
}
|
||||||
finally { if (e_2) throw e_2.error; }
|
finally { if (e_2) throw e_2.error; }
|
||||||
}
|
}
|
||||||
@ -2162,7 +2162,7 @@ const getFilesFromSourceFile = ({ filePaths, excludedFiles = false }) => __await
|
|||||||
* @param value - value of config
|
* @param value - value of config
|
||||||
* @throws Couldn't update git global config
|
* @throws Couldn't update git global config
|
||||||
*/
|
*/
|
||||||
const updateGitGlobalConfig = ({ name, value }) => __awaiter(void 0, void 0, void 0, function* () {
|
const updateGitGlobalConfig = (_j) => __awaiter(void 0, [_j], void 0, function* ({ name, value }) {
|
||||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['config', '--global', name, value], {
|
const { exitCode, stderr } = yield exec.getExecOutput('git', ['config', '--global', name, value], {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: !core.isDebug()
|
silent: !core.isDebug()
|
||||||
@ -2178,7 +2178,7 @@ exports.updateGitGlobalConfig = updateGitGlobalConfig;
|
|||||||
* @param cwd - working directory
|
* @param cwd - working directory
|
||||||
* @returns repository is shallow
|
* @returns repository is shallow
|
||||||
*/
|
*/
|
||||||
const isRepoShallow = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const isRepoShallow = (_k) => __awaiter(void 0, [_k], void 0, function* ({ cwd }) {
|
||||||
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', '--is-shallow-repository'], {
|
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', '--is-shallow-repository'], {
|
||||||
cwd,
|
cwd,
|
||||||
silent: !core.isDebug()
|
silent: !core.isDebug()
|
||||||
@ -2191,7 +2191,7 @@ exports.isRepoShallow = isRepoShallow;
|
|||||||
* @param cwd - working directory
|
* @param cwd - working directory
|
||||||
* @returns submodule exists
|
* @returns submodule exists
|
||||||
*/
|
*/
|
||||||
const submoduleExists = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const submoduleExists = (_l) => __awaiter(void 0, [_l], void 0, function* ({ cwd }) {
|
||||||
const { stdout, exitCode, stderr } = yield exec.getExecOutput('git', ['submodule', 'status'], {
|
const { stdout, exitCode, stderr } = yield exec.getExecOutput('git', ['submodule', 'status'], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
@ -2210,7 +2210,7 @@ exports.submoduleExists = submoduleExists;
|
|||||||
* @param cwd - working directory
|
* @param cwd - working directory
|
||||||
* @returns exit code
|
* @returns exit code
|
||||||
*/
|
*/
|
||||||
const gitFetch = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const gitFetch = (_m) => __awaiter(void 0, [_m], void 0, function* ({ args, cwd }) {
|
||||||
const { exitCode } = yield exec.getExecOutput('git', ['fetch', '-q', ...args], {
|
const { exitCode } = yield exec.getExecOutput('git', ['fetch', '-q', ...args], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
@ -2224,7 +2224,7 @@ exports.gitFetch = gitFetch;
|
|||||||
* @param args - arguments for fetch command
|
* @param args - arguments for fetch command
|
||||||
* @param cwd - working directory
|
* @param cwd - working directory
|
||||||
*/
|
*/
|
||||||
const gitFetchSubmodules = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const gitFetchSubmodules = (_o) => __awaiter(void 0, [_o], void 0, function* ({ args, cwd }) {
|
||||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['submodule', 'foreach', 'git', 'fetch', '-q', ...args], {
|
const { exitCode, stderr } = yield exec.getExecOutput('git', ['submodule', 'foreach', 'git', 'fetch', '-q', ...args], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
@ -2241,7 +2241,7 @@ exports.gitFetchSubmodules = gitFetchSubmodules;
|
|||||||
* @param cwd - working directory
|
* @param cwd - working directory
|
||||||
* @returns submodule paths
|
* @returns submodule paths
|
||||||
*/
|
*/
|
||||||
const getSubmodulePath = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getSubmodulePath = (_p) => __awaiter(void 0, [_p], void 0, function* ({ cwd }) {
|
||||||
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['submodule', 'status'], {
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['submodule', 'status'], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
@ -2266,17 +2266,17 @@ exports.getSubmodulePath = getSubmodulePath;
|
|||||||
* @param diff - diff type between parent commits (`..` or `...`)
|
* @param diff - diff type between parent commits (`..` or `...`)
|
||||||
* @returns commit sha of submodule
|
* @returns commit sha of submodule
|
||||||
*/
|
*/
|
||||||
const gitSubmoduleDiffSHA = ({ cwd, parentSha1, parentSha2, submodulePath, diff }) => __awaiter(void 0, void 0, void 0, function* () {
|
const gitSubmoduleDiffSHA = (_q) => __awaiter(void 0, [_q], void 0, function* ({ cwd, parentSha1, parentSha2, submodulePath, diff }) {
|
||||||
var _h, _j, _k, _l;
|
var _r, _s, _t, _u;
|
||||||
const { stdout } = yield exec.getExecOutput('git', ['diff', `${parentSha1}${diff}${parentSha2}`, '--', submodulePath], {
|
const { stdout } = yield exec.getExecOutput('git', ['diff', `${parentSha1}${diff}${parentSha2}`, '--', submodulePath], {
|
||||||
cwd,
|
cwd,
|
||||||
silent: !core.isDebug()
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
const subprojectCommitPreRegex = /^(?<preCommit>-)Subproject commit (?<commitHash>.+)$/m;
|
const subprojectCommitPreRegex = /^(?<preCommit>-)Subproject commit (?<commitHash>.+)$/m;
|
||||||
const subprojectCommitCurRegex = /^(?<curCommit>\+)Subproject commit (?<commitHash>.+)$/m;
|
const subprojectCommitCurRegex = /^(?<curCommit>\+)Subproject commit (?<commitHash>.+)$/m;
|
||||||
const previousSha = ((_j = (_h = subprojectCommitPreRegex.exec(stdout)) === null || _h === void 0 ? void 0 : _h.groups) === null || _j === void 0 ? void 0 : _j.commitHash) ||
|
const previousSha = ((_s = (_r = subprojectCommitPreRegex.exec(stdout)) === null || _r === void 0 ? void 0 : _r.groups) === null || _s === void 0 ? void 0 : _s.commitHash) ||
|
||||||
'4b825dc642cb6eb9a060e54bf8d69288fbee4904';
|
'4b825dc642cb6eb9a060e54bf8d69288fbee4904';
|
||||||
const currentSha = (_l = (_k = subprojectCommitCurRegex.exec(stdout)) === null || _k === void 0 ? void 0 : _k.groups) === null || _l === void 0 ? void 0 : _l.commitHash;
|
const currentSha = (_u = (_t = subprojectCommitCurRegex.exec(stdout)) === null || _t === void 0 ? void 0 : _t.groups) === null || _u === void 0 ? void 0 : _u.commitHash;
|
||||||
if (currentSha) {
|
if (currentSha) {
|
||||||
return { previousSha, currentSha };
|
return { previousSha, currentSha };
|
||||||
}
|
}
|
||||||
@ -2284,7 +2284,7 @@ const gitSubmoduleDiffSHA = ({ cwd, parentSha1, parentSha2, submodulePath, diff
|
|||||||
return {};
|
return {};
|
||||||
});
|
});
|
||||||
exports.gitSubmoduleDiffSHA = gitSubmoduleDiffSHA;
|
exports.gitSubmoduleDiffSHA = gitSubmoduleDiffSHA;
|
||||||
const gitRenamedFiles = ({ cwd, sha1, sha2, diff, oldNewSeparator, isSubmodule = false, parentDir = '' }) => __awaiter(void 0, void 0, void 0, function* () {
|
const gitRenamedFiles = (_v) => __awaiter(void 0, [_v], void 0, function* ({ cwd, sha1, sha2, diff, oldNewSeparator, isSubmodule = false, parentDir = '' }) {
|
||||||
const { exitCode, stderr, stdout } = yield exec.getExecOutput('git', [
|
const { exitCode, stderr, stdout } = yield exec.getExecOutput('git', [
|
||||||
'diff',
|
'diff',
|
||||||
'--name-status',
|
'--name-status',
|
||||||
@ -2334,7 +2334,7 @@ exports.gitRenamedFiles = gitRenamedFiles;
|
|||||||
* @param failOnInitialDiffError - fail if the initial diff fails
|
* @param failOnInitialDiffError - fail if the initial diff fails
|
||||||
* @param failOnSubmoduleDiffError - fail if the submodule diff fails
|
* @param failOnSubmoduleDiffError - fail if the submodule diff fails
|
||||||
*/
|
*/
|
||||||
const getAllChangedFiles = ({ cwd, sha1, sha2, diff, isSubmodule = false, parentDir = '', outputRenamedFilesAsDeletedAndAdded = false, failOnInitialDiffError = false, failOnSubmoduleDiffError = false }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getAllChangedFiles = (_w) => __awaiter(void 0, [_w], void 0, function* ({ cwd, sha1, sha2, diff, isSubmodule = false, parentDir = '', outputRenamedFilesAsDeletedAndAdded = false, failOnInitialDiffError = false, failOnSubmoduleDiffError = false }) {
|
||||||
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', [
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', [
|
||||||
'diff',
|
'diff',
|
||||||
'--name-status',
|
'--name-status',
|
||||||
@ -2405,7 +2405,7 @@ exports.getAllChangedFiles = getAllChangedFiles;
|
|||||||
* @param allDiffFiles - all the changed files
|
* @param allDiffFiles - all the changed files
|
||||||
* @param filePatterns - file patterns to filter by
|
* @param filePatterns - file patterns to filter by
|
||||||
*/
|
*/
|
||||||
const getFilteredChangedFiles = ({ allDiffFiles, filePatterns }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getFilteredChangedFiles = (_x) => __awaiter(void 0, [_x], void 0, function* ({ allDiffFiles, filePatterns }) {
|
||||||
const changedFiles = {
|
const changedFiles = {
|
||||||
[changedFiles_1.ChangeTypeEnum.Added]: [],
|
[changedFiles_1.ChangeTypeEnum.Added]: [],
|
||||||
[changedFiles_1.ChangeTypeEnum.Copied]: [],
|
[changedFiles_1.ChangeTypeEnum.Copied]: [],
|
||||||
@ -2434,7 +2434,7 @@ const getFilteredChangedFiles = ({ allDiffFiles, filePatterns }) => __awaiter(vo
|
|||||||
return changedFiles;
|
return changedFiles;
|
||||||
});
|
});
|
||||||
exports.getFilteredChangedFiles = getFilteredChangedFiles;
|
exports.getFilteredChangedFiles = getFilteredChangedFiles;
|
||||||
const gitLog = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const gitLog = (_y) => __awaiter(void 0, [_y], void 0, function* ({ args, cwd }) {
|
||||||
const { stdout } = yield exec.getExecOutput('git', ['log', ...args], {
|
const { stdout } = yield exec.getExecOutput('git', ['log', ...args], {
|
||||||
cwd,
|
cwd,
|
||||||
silent: !core.isDebug()
|
silent: !core.isDebug()
|
||||||
@ -2442,7 +2442,7 @@ const gitLog = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* ()
|
|||||||
return stdout.trim();
|
return stdout.trim();
|
||||||
});
|
});
|
||||||
exports.gitLog = gitLog;
|
exports.gitLog = gitLog;
|
||||||
const getHeadSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getHeadSha = (_z) => __awaiter(void 0, [_z], void 0, function* ({ cwd }) {
|
||||||
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', 'HEAD'], {
|
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', 'HEAD'], {
|
||||||
cwd,
|
cwd,
|
||||||
silent: !core.isDebug()
|
silent: !core.isDebug()
|
||||||
@ -2450,7 +2450,7 @@ const getHeadSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
|||||||
return stdout.trim();
|
return stdout.trim();
|
||||||
});
|
});
|
||||||
exports.getHeadSha = getHeadSha;
|
exports.getHeadSha = getHeadSha;
|
||||||
const isInsideWorkTree = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const isInsideWorkTree = (_0) => __awaiter(void 0, [_0], void 0, function* ({ cwd }) {
|
||||||
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', '--is-inside-work-tree'], {
|
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', '--is-inside-work-tree'], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
@ -2462,7 +2462,7 @@ const isInsideWorkTree = ({ cwd }) => __awaiter(void 0, void 0, void 0, function
|
|||||||
return stdout.trim() === 'true';
|
return stdout.trim() === 'true';
|
||||||
});
|
});
|
||||||
exports.isInsideWorkTree = isInsideWorkTree;
|
exports.isInsideWorkTree = isInsideWorkTree;
|
||||||
const getRemoteBranchHeadSha = ({ cwd, branch }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getRemoteBranchHeadSha = (_1) => __awaiter(void 0, [_1], void 0, function* ({ cwd, branch }) {
|
||||||
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', `origin/${branch}`], {
|
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', `origin/${branch}`], {
|
||||||
cwd,
|
cwd,
|
||||||
silent: !core.isDebug()
|
silent: !core.isDebug()
|
||||||
@ -2470,7 +2470,7 @@ const getRemoteBranchHeadSha = ({ cwd, branch }) => __awaiter(void 0, void 0, vo
|
|||||||
return stdout.trim();
|
return stdout.trim();
|
||||||
});
|
});
|
||||||
exports.getRemoteBranchHeadSha = getRemoteBranchHeadSha;
|
exports.getRemoteBranchHeadSha = getRemoteBranchHeadSha;
|
||||||
const getCurrentBranchName = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getCurrentBranchName = (_2) => __awaiter(void 0, [_2], void 0, function* ({ cwd }) {
|
||||||
const { stdout, exitCode } = yield exec.getExecOutput('git', ['rev-parse', '--abbrev-ref', 'HEAD'], {
|
const { stdout, exitCode } = yield exec.getExecOutput('git', ['rev-parse', '--abbrev-ref', 'HEAD'], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
@ -2482,7 +2482,7 @@ const getCurrentBranchName = ({ cwd }) => __awaiter(void 0, void 0, void 0, func
|
|||||||
return stdout.trim();
|
return stdout.trim();
|
||||||
});
|
});
|
||||||
exports.getCurrentBranchName = getCurrentBranchName;
|
exports.getCurrentBranchName = getCurrentBranchName;
|
||||||
const getParentSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getParentSha = (_3) => __awaiter(void 0, [_3], void 0, function* ({ cwd }) {
|
||||||
const { stdout, exitCode } = yield exec.getExecOutput('git', ['rev-list', '-n', '1', 'HEAD^'], {
|
const { stdout, exitCode } = yield exec.getExecOutput('git', ['rev-list', '-n', '1', 'HEAD^'], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
@ -2494,7 +2494,7 @@ const getParentSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* ()
|
|||||||
return stdout.trim();
|
return stdout.trim();
|
||||||
});
|
});
|
||||||
exports.getParentSha = getParentSha;
|
exports.getParentSha = getParentSha;
|
||||||
const verifyCommitSha = ({ sha, cwd, showAsErrorMessage = true }) => __awaiter(void 0, void 0, void 0, function* () {
|
const verifyCommitSha = (_4) => __awaiter(void 0, [_4], void 0, function* ({ sha, cwd, showAsErrorMessage = true }) {
|
||||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['rev-parse', '--verify', `${sha}^{commit}`], {
|
const { exitCode, stderr } = yield exec.getExecOutput('git', ['rev-parse', '--verify', `${sha}^{commit}`], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
@ -2526,7 +2526,7 @@ exports.verifyCommitSha = verifyCommitSha;
|
|||||||
* @param token The GitHub token.
|
* @param token The GitHub token.
|
||||||
* @returns The cleaned SHA string.
|
* @returns The cleaned SHA string.
|
||||||
*/
|
*/
|
||||||
const cleanShaInput = ({ sha, cwd, token }) => __awaiter(void 0, void 0, void 0, function* () {
|
const cleanShaInput = (_5) => __awaiter(void 0, [_5], void 0, function* ({ sha, cwd, token }) {
|
||||||
// Check if the input is a valid commit sha
|
// Check if the input is a valid commit sha
|
||||||
if (!sha) {
|
if (!sha) {
|
||||||
return sha;
|
return sha;
|
||||||
@ -2550,7 +2550,7 @@ const cleanShaInput = ({ sha, cwd, token }) => __awaiter(void 0, void 0, void 0,
|
|||||||
return stdout.trim();
|
return stdout.trim();
|
||||||
});
|
});
|
||||||
exports.cleanShaInput = cleanShaInput;
|
exports.cleanShaInput = cleanShaInput;
|
||||||
const getPreviousGitTag = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getPreviousGitTag = (_6) => __awaiter(void 0, [_6], void 0, function* ({ cwd }) {
|
||||||
const { stdout } = yield exec.getExecOutput('git', ['tag', '--sort=-creatordate'], {
|
const { stdout } = yield exec.getExecOutput('git', ['tag', '--sort=-creatordate'], {
|
||||||
cwd,
|
cwd,
|
||||||
silent: !core.isDebug()
|
silent: !core.isDebug()
|
||||||
@ -2569,7 +2569,7 @@ const getPreviousGitTag = ({ cwd }) => __awaiter(void 0, void 0, void 0, functio
|
|||||||
return { tag: previousTag, sha };
|
return { tag: previousTag, sha };
|
||||||
});
|
});
|
||||||
exports.getPreviousGitTag = getPreviousGitTag;
|
exports.getPreviousGitTag = getPreviousGitTag;
|
||||||
const canDiffCommits = ({ cwd, sha1, sha2, diff }) => __awaiter(void 0, void 0, void 0, function* () {
|
const canDiffCommits = (_7) => __awaiter(void 0, [_7], void 0, function* ({ cwd, sha1, sha2, diff }) {
|
||||||
if (diff === '...') {
|
if (diff === '...') {
|
||||||
const mergeBase = yield getMergeBase(cwd, sha1, sha2);
|
const mergeBase = yield getMergeBase(cwd, sha1, sha2);
|
||||||
if (!mergeBase) {
|
if (!mergeBase) {
|
||||||
@ -2636,7 +2636,7 @@ const getDirNamesIncludeFilesPattern = ({ inputs }) => {
|
|||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
};
|
};
|
||||||
exports.getDirNamesIncludeFilesPattern = getDirNamesIncludeFilesPattern;
|
exports.getDirNamesIncludeFilesPattern = getDirNamesIncludeFilesPattern;
|
||||||
const getFilePatterns = ({ inputs, workingDirectory }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getFilePatterns = (_8) => __awaiter(void 0, [_8], void 0, function* ({ inputs, workingDirectory }) {
|
||||||
let cleanedFilePatterns = [];
|
let cleanedFilePatterns = [];
|
||||||
if (inputs.files) {
|
if (inputs.files) {
|
||||||
const filesPatterns = inputs.files
|
const filesPatterns = inputs.files
|
||||||
@ -2703,7 +2703,7 @@ const getFilePatterns = ({ inputs, workingDirectory }) => __awaiter(void 0, void
|
|||||||
return cleanedFilePatterns;
|
return cleanedFilePatterns;
|
||||||
});
|
});
|
||||||
exports.getFilePatterns = getFilePatterns;
|
exports.getFilePatterns = getFilePatterns;
|
||||||
const getYamlFilePatternsFromContents = ({ content = '', filePath = '', excludedFiles = false }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getYamlFilePatternsFromContents = (_9) => __awaiter(void 0, [_9], void 0, function* ({ content = '', filePath = '', excludedFiles = false }) {
|
||||||
const filePatterns = {};
|
const filePatterns = {};
|
||||||
let source = '';
|
let source = '';
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
@ -2760,7 +2760,7 @@ const getYamlFilePatternsFromContents = ({ content = '', filePath = '', excluded
|
|||||||
}
|
}
|
||||||
return filePatterns;
|
return filePatterns;
|
||||||
});
|
});
|
||||||
const getYamlFilePatterns = ({ inputs, workingDirectory }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getYamlFilePatterns = (_10) => __awaiter(void 0, [_10], void 0, function* ({ inputs, workingDirectory }) {
|
||||||
let filePatterns = {};
|
let filePatterns = {};
|
||||||
if (inputs.filesYaml) {
|
if (inputs.filesYaml) {
|
||||||
filePatterns = Object.assign({}, (yield getYamlFilePatternsFromContents({ content: inputs.filesYaml })));
|
filePatterns = Object.assign({}, (yield getYamlFilePatternsFromContents({ content: inputs.filesYaml })));
|
||||||
@ -2835,7 +2835,7 @@ const getOutputKey = (key, outputPrefix) => {
|
|||||||
return outputPrefix ? `${outputPrefix}_${key}` : key;
|
return outputPrefix ? `${outputPrefix}_${key}` : key;
|
||||||
};
|
};
|
||||||
exports.getOutputKey = getOutputKey;
|
exports.getOutputKey = getOutputKey;
|
||||||
const setArrayOutput = ({ key, inputs, value, outputPrefix }) => __awaiter(void 0, void 0, void 0, function* () {
|
const setArrayOutput = (_11) => __awaiter(void 0, [_11], void 0, function* ({ key, inputs, value, outputPrefix }) {
|
||||||
core.debug(`${key}: ${JSON.stringify(value)}`);
|
core.debug(`${key}: ${JSON.stringify(value)}`);
|
||||||
yield (0, exports.setOutput)({
|
yield (0, exports.setOutput)({
|
||||||
key: outputPrefix ? (0, exports.getOutputKey)(key, outputPrefix) : key,
|
key: outputPrefix ? (0, exports.getOutputKey)(key, outputPrefix) : key,
|
||||||
@ -2848,7 +2848,7 @@ const setArrayOutput = ({ key, inputs, value, outputPrefix }) => __awaiter(void
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
exports.setArrayOutput = setArrayOutput;
|
exports.setArrayOutput = setArrayOutput;
|
||||||
const setOutput = ({ key, value, writeOutputFiles, outputDir, json = false, shouldEscape = false, safeOutput = false }) => __awaiter(void 0, void 0, void 0, function* () {
|
const setOutput = (_12) => __awaiter(void 0, [_12], void 0, function* ({ key, value, writeOutputFiles, outputDir, json = false, shouldEscape = false, safeOutput = false }) {
|
||||||
let cleanedValue;
|
let cleanedValue;
|
||||||
if (json) {
|
if (json) {
|
||||||
cleanedValue = (0, exports.jsonOutput)({ value, shouldEscape });
|
cleanedValue = (0, exports.jsonOutput)({ value, shouldEscape });
|
||||||
@ -2871,7 +2871,7 @@ const setOutput = ({ key, value, writeOutputFiles, outputDir, json = false, shou
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
exports.setOutput = setOutput;
|
exports.setOutput = setOutput;
|
||||||
const getDeletedFileContents = ({ cwd, filePath, sha }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getDeletedFileContents = (_13) => __awaiter(void 0, [_13], void 0, function* ({ cwd, filePath, sha }) {
|
||||||
const { stdout, exitCode, stderr } = yield exec.getExecOutput('git', ['show', `${sha}:${filePath}`], {
|
const { stdout, exitCode, stderr } = yield exec.getExecOutput('git', ['show', `${sha}:${filePath}`], {
|
||||||
cwd,
|
cwd,
|
||||||
silent: !core.isDebug(),
|
silent: !core.isDebug(),
|
||||||
@ -2882,7 +2882,7 @@ const getDeletedFileContents = ({ cwd, filePath, sha }) => __awaiter(void 0, voi
|
|||||||
}
|
}
|
||||||
return stdout;
|
return stdout;
|
||||||
});
|
});
|
||||||
const recoverDeletedFiles = ({ inputs, workingDirectory, deletedFiles, recoverPatterns, diffResult, hasSubmodule, submodulePaths }) => __awaiter(void 0, void 0, void 0, function* () {
|
const recoverDeletedFiles = (_14) => __awaiter(void 0, [_14], void 0, function* ({ inputs, workingDirectory, deletedFiles, recoverPatterns, diffResult, hasSubmodule, submodulePaths }) {
|
||||||
let recoverableDeletedFiles = deletedFiles;
|
let recoverableDeletedFiles = deletedFiles;
|
||||||
core.debug(`recoverable deleted files: ${recoverableDeletedFiles}`);
|
core.debug(`recoverable deleted files: ${recoverableDeletedFiles}`);
|
||||||
if (recoverPatterns.length > 0) {
|
if (recoverPatterns.length > 0) {
|
||||||
@ -2947,7 +2947,7 @@ exports.recoverDeletedFiles = recoverDeletedFiles;
|
|||||||
* @param workingDirectory - The path of the working directory.
|
* @param workingDirectory - The path of the working directory.
|
||||||
* @returns A boolean value indicating whether the working directory has a local Git directory.
|
* @returns A boolean value indicating whether the working directory has a local Git directory.
|
||||||
*/
|
*/
|
||||||
const hasLocalGitDirectory = ({ workingDirectory }) => __awaiter(void 0, void 0, void 0, function* () {
|
const hasLocalGitDirectory = (_15) => __awaiter(void 0, [_15], void 0, function* ({ workingDirectory }) {
|
||||||
return yield (0, exports.isInsideWorkTree)({
|
return yield (0, exports.isInsideWorkTree)({
|
||||||
cwd: workingDirectory
|
cwd: workingDirectory
|
||||||
});
|
});
|
||||||
@ -2958,13 +2958,13 @@ exports.hasLocalGitDirectory = hasLocalGitDirectory;
|
|||||||
*
|
*
|
||||||
* @param inputs - The inputs object.
|
* @param inputs - The inputs object.
|
||||||
*/
|
*/
|
||||||
const warnUnsupportedRESTAPIInputs = ({ inputs }) => __awaiter(void 0, void 0, void 0, function* () {
|
const warnUnsupportedRESTAPIInputs = (_16) => __awaiter(void 0, [_16], void 0, function* ({ inputs }) {
|
||||||
var _m, _o;
|
var _17, _18;
|
||||||
for (const key of Object.keys(constant_1.DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS)) {
|
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)
|
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()
|
? (_17 = constant_1.DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS[key]) === null || _17 === void 0 ? void 0 : _17.toString()
|
||||||
: '';
|
: '';
|
||||||
if (defaultValue !== ((_o = inputs[key]) === null || _o === void 0 ? void 0 : _o.toString())) {
|
if (defaultValue !== ((_18 = inputs[key]) === null || _18 === void 0 ? void 0 : _18.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
Loading…
x
Reference in New Issue
Block a user