Added missing changes and modified dist assets.
This commit is contained in:
parent
2b9972b68d
commit
264f5d189c
61
dist/index.js
generated
vendored
61
dist/index.js
generated
vendored
@ -240,11 +240,24 @@ const getChangedFilesFromGithubAPI = ({ inputs, env }) => __awaiter(void 0, void
|
||||
_c = _f.value;
|
||||
_d = false;
|
||||
const response = _c;
|
||||
for (const paginatedItems of response.data) {
|
||||
for (const item of paginatedItems) {
|
||||
const changeType = item.status === 'removed'
|
||||
? ChangeTypeEnum.Deleted
|
||||
: item.status;
|
||||
if (response.status !== 200) {
|
||||
throw new Error(`Failed to get changed files from GitHub API. Status: ${response.status}`);
|
||||
}
|
||||
core.info(`Got ${response.data.length} changed files from GitHub API`);
|
||||
for (const item of response.data) {
|
||||
const changeType = item.status === 'removed'
|
||||
? ChangeTypeEnum.Deleted
|
||||
: item.status;
|
||||
if (changeType === ChangeTypeEnum.Renamed) {
|
||||
if (inputs.outputRenamedFilesAsDeletedAndAdded) {
|
||||
changedFiles[ChangeTypeEnum.Deleted].push(item.filename);
|
||||
changedFiles[ChangeTypeEnum.Added].push(item.filename);
|
||||
}
|
||||
else {
|
||||
changedFiles[ChangeTypeEnum.Renamed].push(item.filename);
|
||||
}
|
||||
}
|
||||
else {
|
||||
changedFiles[changeType].push(item.filename);
|
||||
}
|
||||
}
|
||||
@ -1708,7 +1721,7 @@ const versionToNumber = (version) => {
|
||||
return major * 1000000 + minor * 1000 + patch;
|
||||
};
|
||||
const verifyMinimumGitVersion = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['--version'], { silent: process.env.RUNNER_DEBUG !== '1' });
|
||||
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['--version'], { silent: !core.isDebug() });
|
||||
if (exitCode !== 0) {
|
||||
throw new Error(stderr || 'An unexpected error occurred');
|
||||
}
|
||||
@ -1793,7 +1806,7 @@ const getFilesFromSourceFile = ({ filePaths, excludedFiles = false }) => __await
|
||||
const updateGitGlobalConfig = ({ name, value }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['config', '--global', name, value], {
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
/* istanbul ignore if */
|
||||
if (exitCode !== 0 || stderr) {
|
||||
@ -1804,7 +1817,7 @@ exports.updateGitGlobalConfig = updateGitGlobalConfig;
|
||||
const isRepoShallow = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', '--is-shallow-repository'], {
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
return stdout.trim() === 'true';
|
||||
});
|
||||
@ -1813,7 +1826,7 @@ const submoduleExists = ({ cwd }) => __awaiter(void 0, void 0, void 0, function*
|
||||
const { stdout, exitCode } = yield exec.getExecOutput('git', ['submodule', 'status'], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
if (exitCode !== 0) {
|
||||
return false;
|
||||
@ -1825,7 +1838,7 @@ const gitFetch = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function*
|
||||
const { exitCode } = yield exec.getExecOutput('git', ['fetch', '-q', ...args], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
return exitCode;
|
||||
});
|
||||
@ -1834,7 +1847,7 @@ const gitFetchSubmodules = ({ args, cwd }) => __awaiter(void 0, void 0, void 0,
|
||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['submodule', 'foreach', 'git', 'fetch', '-q', ...args], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
/* istanbul ignore if */
|
||||
if (exitCode !== 0) {
|
||||
@ -1849,7 +1862,7 @@ const getSubmodulePath = ({ cwd }) => __awaiter(void 0, void 0, void 0, function
|
||||
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['submodule', 'status'], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
if (exitCode !== 0) {
|
||||
core.warning(stderr || "Couldn't get submodule names");
|
||||
@ -1865,7 +1878,7 @@ const gitSubmoduleDiffSHA = ({ cwd, parentSha1, parentSha2, submodulePath, diff
|
||||
var _h, _j, _k, _l;
|
||||
const { stdout } = yield exec.getExecOutput('git', ['diff', parentSha1, parentSha2, '--', submodulePath], {
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
const subprojectCommitPreRegex = /^(?<preCommit>-)Subproject commit (?<commitHash>.+)$/m;
|
||||
const subprojectCommitCurRegex = /^(?<curCommit>\+)Subproject commit (?<commitHash>.+)$/m;
|
||||
@ -1889,7 +1902,7 @@ const gitRenamedFiles = ({ cwd, sha1, sha2, diff, oldNewSeparator, isSubmodule =
|
||||
], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
if (exitCode !== 0) {
|
||||
if (isSubmodule) {
|
||||
@ -1927,7 +1940,7 @@ const getAllChangedFiles = ({ cwd, sha1, sha2, diff, isSubmodule = false, parent
|
||||
], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
const changedFiles = {
|
||||
[changedFiles_1.ChangeTypeEnum.Added]: [],
|
||||
@ -2006,7 +2019,7 @@ exports.getFilteredChangedFiles = getFilteredChangedFiles;
|
||||
const gitLog = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['log', ...args], {
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
return stdout.trim();
|
||||
});
|
||||
@ -2014,7 +2027,7 @@ exports.gitLog = gitLog;
|
||||
const getHeadSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', 'HEAD'], {
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
return stdout.trim();
|
||||
});
|
||||
@ -2022,7 +2035,7 @@ exports.getHeadSha = getHeadSha;
|
||||
const getRemoteBranchHeadSha = ({ cwd, branch }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', `origin/${branch}`], {
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
return stdout.trim();
|
||||
});
|
||||
@ -2031,7 +2044,7 @@ const getParentSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* ()
|
||||
const { stdout, exitCode } = yield exec.getExecOutput('git', ['rev-list', '-n', '1', 'HEAD^'], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
if (exitCode !== 0) {
|
||||
return '';
|
||||
@ -2043,7 +2056,7 @@ const verifyCommitSha = ({ sha, cwd, showAsErrorMessage = true }) => __awaiter(v
|
||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['rev-parse', '--verify', `${sha}^{commit}`], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
if (exitCode !== 0) {
|
||||
if (showAsErrorMessage) {
|
||||
@ -2062,7 +2075,7 @@ exports.verifyCommitSha = verifyCommitSha;
|
||||
const getPreviousGitTag = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['tag', '--sort=-version:refname'], {
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
const tags = stdout.trim().split('\n');
|
||||
if (tags.length < 2) {
|
||||
@ -2072,7 +2085,7 @@ const getPreviousGitTag = ({ cwd }) => __awaiter(void 0, void 0, void 0, functio
|
||||
const previousTag = tags[1];
|
||||
const { stdout: stdout2 } = yield exec.getExecOutput('git', ['rev-parse', previousTag], {
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
const sha = stdout2.trim();
|
||||
return { tag: previousTag, sha };
|
||||
@ -2082,7 +2095,7 @@ const canDiffCommits = ({ cwd, sha1, sha2, diff }) => __awaiter(void 0, void 0,
|
||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['diff', '--name-only', '--ignore-submodules=all', `${sha1}${diff}${sha2}`], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
if (exitCode !== 0) {
|
||||
core.warning(stderr || `Unable find merge base between ${sha1} and ${sha2}`);
|
||||
@ -2305,7 +2318,7 @@ exports.setOutput = setOutput;
|
||||
const getDeletedFileContents = ({ cwd, filePath, sha }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout, exitCode, stderr } = yield exec.getExecOutput('git', ['show', `${sha}:${filePath}`], {
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1',
|
||||
silent: !core.isDebug(),
|
||||
ignoreReturnCode: true
|
||||
});
|
||||
if (exitCode !== 0) {
|
||||
|
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