Added missing changes and modified dist assets.
This commit is contained in:
parent
2b9972b68d
commit
264f5d189c
55
dist/index.js
generated
vendored
55
dist/index.js
generated
vendored
@ -240,11 +240,24 @@ const getChangedFilesFromGithubAPI = ({ inputs, env }) => __awaiter(void 0, void
|
|||||||
_c = _f.value;
|
_c = _f.value;
|
||||||
_d = false;
|
_d = false;
|
||||||
const response = _c;
|
const response = _c;
|
||||||
for (const paginatedItems of response.data) {
|
if (response.status !== 200) {
|
||||||
for (const item of paginatedItems) {
|
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'
|
const changeType = item.status === 'removed'
|
||||||
? ChangeTypeEnum.Deleted
|
? ChangeTypeEnum.Deleted
|
||||||
: item.status;
|
: 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);
|
changedFiles[changeType].push(item.filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1708,7 +1721,7 @@ const versionToNumber = (version) => {
|
|||||||
return major * 1000000 + minor * 1000 + patch;
|
return major * 1000000 + minor * 1000 + patch;
|
||||||
};
|
};
|
||||||
const verifyMinimumGitVersion = () => __awaiter(void 0, void 0, void 0, function* () {
|
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) {
|
if (exitCode !== 0) {
|
||||||
throw new Error(stderr || 'An unexpected error occurred');
|
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 updateGitGlobalConfig = ({ name, value }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
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: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
/* istanbul ignore if */
|
/* istanbul ignore if */
|
||||||
if (exitCode !== 0 || stderr) {
|
if (exitCode !== 0 || stderr) {
|
||||||
@ -1804,7 +1817,7 @@ exports.updateGitGlobalConfig = updateGitGlobalConfig;
|
|||||||
const isRepoShallow = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const isRepoShallow = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
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: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
return stdout.trim() === 'true';
|
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'], {
|
const { stdout, exitCode } = yield exec.getExecOutput('git', ['submodule', 'status'], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
return false;
|
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], {
|
const { exitCode } = yield exec.getExecOutput('git', ['fetch', '-q', ...args], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
return exitCode;
|
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], {
|
const { exitCode, stderr } = yield exec.getExecOutput('git', ['submodule', 'foreach', 'git', 'fetch', '-q', ...args], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
/* istanbul ignore if */
|
/* istanbul ignore if */
|
||||||
if (exitCode !== 0) {
|
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'], {
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['submodule', 'status'], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
core.warning(stderr || "Couldn't get submodule names");
|
core.warning(stderr || "Couldn't get submodule names");
|
||||||
@ -1865,7 +1878,7 @@ const gitSubmoduleDiffSHA = ({ cwd, parentSha1, parentSha2, submodulePath, diff
|
|||||||
var _h, _j, _k, _l;
|
var _h, _j, _k, _l;
|
||||||
const { stdout } = yield exec.getExecOutput('git', ['diff', parentSha1, parentSha2, '--', submodulePath], {
|
const { stdout } = yield exec.getExecOutput('git', ['diff', parentSha1, parentSha2, '--', submodulePath], {
|
||||||
cwd,
|
cwd,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
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;
|
||||||
@ -1889,7 +1902,7 @@ const gitRenamedFiles = ({ cwd, sha1, sha2, diff, oldNewSeparator, isSubmodule =
|
|||||||
], {
|
], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
if (isSubmodule) {
|
if (isSubmodule) {
|
||||||
@ -1927,7 +1940,7 @@ const getAllChangedFiles = ({ cwd, sha1, sha2, diff, isSubmodule = false, parent
|
|||||||
], {
|
], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
const changedFiles = {
|
const changedFiles = {
|
||||||
[changedFiles_1.ChangeTypeEnum.Added]: [],
|
[changedFiles_1.ChangeTypeEnum.Added]: [],
|
||||||
@ -2006,7 +2019,7 @@ exports.getFilteredChangedFiles = getFilteredChangedFiles;
|
|||||||
const gitLog = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const gitLog = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const { stdout } = yield exec.getExecOutput('git', ['log', ...args], {
|
const { stdout } = yield exec.getExecOutput('git', ['log', ...args], {
|
||||||
cwd,
|
cwd,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
return stdout.trim();
|
return stdout.trim();
|
||||||
});
|
});
|
||||||
@ -2014,7 +2027,7 @@ exports.gitLog = gitLog;
|
|||||||
const getHeadSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getHeadSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', 'HEAD'], {
|
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', 'HEAD'], {
|
||||||
cwd,
|
cwd,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
return stdout.trim();
|
return stdout.trim();
|
||||||
});
|
});
|
||||||
@ -2022,7 +2035,7 @@ exports.getHeadSha = getHeadSha;
|
|||||||
const getRemoteBranchHeadSha = ({ cwd, branch }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getRemoteBranchHeadSha = ({ cwd, branch }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', `origin/${branch}`], {
|
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', `origin/${branch}`], {
|
||||||
cwd,
|
cwd,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
return stdout.trim();
|
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^'], {
|
const { stdout, exitCode } = yield exec.getExecOutput('git', ['rev-list', '-n', '1', 'HEAD^'], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
return '';
|
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}`], {
|
const { exitCode, stderr } = yield exec.getExecOutput('git', ['rev-parse', '--verify', `${sha}^{commit}`], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
if (showAsErrorMessage) {
|
if (showAsErrorMessage) {
|
||||||
@ -2062,7 +2075,7 @@ exports.verifyCommitSha = verifyCommitSha;
|
|||||||
const getPreviousGitTag = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getPreviousGitTag = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const { stdout } = yield exec.getExecOutput('git', ['tag', '--sort=-version:refname'], {
|
const { stdout } = yield exec.getExecOutput('git', ['tag', '--sort=-version:refname'], {
|
||||||
cwd,
|
cwd,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
const tags = stdout.trim().split('\n');
|
const tags = stdout.trim().split('\n');
|
||||||
if (tags.length < 2) {
|
if (tags.length < 2) {
|
||||||
@ -2072,7 +2085,7 @@ const getPreviousGitTag = ({ cwd }) => __awaiter(void 0, void 0, void 0, functio
|
|||||||
const previousTag = tags[1];
|
const previousTag = tags[1];
|
||||||
const { stdout: stdout2 } = yield exec.getExecOutput('git', ['rev-parse', previousTag], {
|
const { stdout: stdout2 } = yield exec.getExecOutput('git', ['rev-parse', previousTag], {
|
||||||
cwd,
|
cwd,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
const sha = stdout2.trim();
|
const sha = stdout2.trim();
|
||||||
return { tag: previousTag, sha };
|
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}`], {
|
const { exitCode, stderr } = yield exec.getExecOutput('git', ['diff', '--name-only', '--ignore-submodules=all', `${sha1}${diff}${sha2}`], {
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: process.env.RUNNER_DEBUG !== '1'
|
silent: !core.isDebug()
|
||||||
});
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
core.warning(stderr || `Unable find merge base between ${sha1} and ${sha2}`);
|
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 getDeletedFileContents = ({ cwd, filePath, sha }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
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: process.env.RUNNER_DEBUG !== '1',
|
silent: !core.isDebug(),
|
||||||
ignoreReturnCode: true
|
ignoreReturnCode: true
|
||||||
});
|
});
|
||||||
if (exitCode !== 0) {
|
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