Enable silent mode
This commit is contained in:
parent
fc9b15c757
commit
7f23de0848
89
dist/index.js
generated
vendored
89
dist/index.js
generated
vendored
@ -1110,9 +1110,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', [
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['--version'], { silent: true });
|
||||||
'--version'
|
|
||||||
]);
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
throw new Error(stderr || 'An unexpected error occurred');
|
throw new Error(stderr || 'An unexpected error occurred');
|
||||||
}
|
}
|
||||||
@ -1245,7 +1243,8 @@ function getFilesFromSourceFile({ filePaths, excludedFiles = false }) {
|
|||||||
exports.getFilesFromSourceFile = getFilesFromSourceFile;
|
exports.getFilesFromSourceFile = getFilesFromSourceFile;
|
||||||
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: true
|
||||||
});
|
});
|
||||||
/* istanbul ignore if */
|
/* istanbul ignore if */
|
||||||
if (exitCode !== 0 || stderr) {
|
if (exitCode !== 0 || stderr) {
|
||||||
@ -1254,7 +1253,10 @@ const updateGitGlobalConfig = ({ name, value }) => __awaiter(void 0, void 0, voi
|
|||||||
});
|
});
|
||||||
exports.updateGitGlobalConfig = updateGitGlobalConfig;
|
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 { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['rev-parse', '--is-shallow-repository'], { cwd });
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['rev-parse', '--is-shallow-repository'], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
throw new Error(stderr || 'An unexpected error occurred');
|
throw new Error(stderr || 'An unexpected error occurred');
|
||||||
}
|
}
|
||||||
@ -1262,7 +1264,10 @@ const isRepoShallow = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* (
|
|||||||
});
|
});
|
||||||
exports.isRepoShallow = isRepoShallow;
|
exports.isRepoShallow = isRepoShallow;
|
||||||
const submoduleExists = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const submoduleExists = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['submodule', 'status'], { cwd });
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['submodule', 'status'], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
throw new Error(stderr || 'An unexpected error occurred');
|
throw new Error(stderr || 'An unexpected error occurred');
|
||||||
}
|
}
|
||||||
@ -1270,7 +1275,10 @@ const submoduleExists = ({ cwd }) => __awaiter(void 0, void 0, void 0, function*
|
|||||||
});
|
});
|
||||||
exports.submoduleExists = submoduleExists;
|
exports.submoduleExists = submoduleExists;
|
||||||
const gitFetch = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const gitFetch = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['fetch', ...args], { cwd });
|
const { exitCode, stderr } = yield exec.getExecOutput('git', ['fetch', ...args], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
/* istanbul ignore if */
|
/* istanbul ignore if */
|
||||||
if (exitCode !== 0 || stderr) {
|
if (exitCode !== 0 || stderr) {
|
||||||
core.warning(stderr || "Couldn't fetch repository");
|
core.warning(stderr || "Couldn't fetch repository");
|
||||||
@ -1279,7 +1287,10 @@ const gitFetch = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function*
|
|||||||
});
|
});
|
||||||
exports.gitFetch = gitFetch;
|
exports.gitFetch = gitFetch;
|
||||||
const gitFetchSubmodules = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const gitFetchSubmodules = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['submodule', 'foreach', 'git', 'fetch', ...args], { cwd });
|
const { exitCode, stderr } = yield exec.getExecOutput('git', ['submodule', 'foreach', 'git', 'fetch', ...args], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
/* istanbul ignore if */
|
/* istanbul ignore if */
|
||||||
if (exitCode !== 0 || stderr) {
|
if (exitCode !== 0 || stderr) {
|
||||||
core.warning(stderr || "Couldn't fetch submodules");
|
core.warning(stderr || "Couldn't fetch submodules");
|
||||||
@ -1287,7 +1298,10 @@ const gitFetchSubmodules = ({ args, cwd }) => __awaiter(void 0, void 0, void 0,
|
|||||||
});
|
});
|
||||||
exports.gitFetchSubmodules = gitFetchSubmodules;
|
exports.gitFetchSubmodules = gitFetchSubmodules;
|
||||||
const getSubmodulePath = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getSubmodulePath = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['submodule', 'status'], { cwd });
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['submodule', 'status'], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
core.warning(stderr || "Couldn't get submodule names");
|
core.warning(stderr || "Couldn't get submodule names");
|
||||||
return [];
|
return [];
|
||||||
@ -1300,7 +1314,10 @@ const getSubmodulePath = ({ cwd }) => __awaiter(void 0, void 0, void 0, function
|
|||||||
exports.getSubmodulePath = getSubmodulePath;
|
exports.getSubmodulePath = getSubmodulePath;
|
||||||
const gitSubmoduleDiffSHA = ({ cwd, parentSha1, parentSha2, submodulePath, diff }) => __awaiter(void 0, void 0, void 0, function* () {
|
const gitSubmoduleDiffSHA = ({ cwd, parentSha1, parentSha2, submodulePath, diff }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
var _a, _b, _c, _d;
|
var _a, _b, _c, _d;
|
||||||
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['diff', parentSha1, parentSha2, '--', submodulePath], { cwd });
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['diff', parentSha1, parentSha2, '--', submodulePath], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
throw new Error(stderr || 'An unexpected error occurred');
|
throw new Error(stderr || 'An unexpected error occurred');
|
||||||
}
|
}
|
||||||
@ -1312,7 +1329,7 @@ const gitSubmoduleDiffSHA = ({ cwd, parentSha1, parentSha2, submodulePath, diff
|
|||||||
if (currentSha) {
|
if (currentSha) {
|
||||||
return { previousSha, currentSha };
|
return { previousSha, currentSha };
|
||||||
}
|
}
|
||||||
core.warning(`No submodule commit found for ${submodulePath} between ${parentSha1}${diff}${parentSha2}`);
|
core.debug(`No submodule commit found for ${submodulePath} between ${parentSha1}${diff}${parentSha2}`);
|
||||||
return {};
|
return {};
|
||||||
});
|
});
|
||||||
exports.gitSubmoduleDiffSHA = gitSubmoduleDiffSHA;
|
exports.gitSubmoduleDiffSHA = gitSubmoduleDiffSHA;
|
||||||
@ -1323,7 +1340,10 @@ const gitRenamedFiles = ({ cwd, sha1, sha2, diff, oldNewSeparator, isSubmodule =
|
|||||||
'--ignore-submodules=all',
|
'--ignore-submodules=all',
|
||||||
'--diff-filter=R',
|
'--diff-filter=R',
|
||||||
`${sha1}${diff}${sha2}`
|
`${sha1}${diff}${sha2}`
|
||||||
], { cwd });
|
], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
if (isSubmodule) {
|
if (isSubmodule) {
|
||||||
core.warning(stderr ||
|
core.warning(stderr ||
|
||||||
@ -1352,7 +1372,10 @@ const gitDiff = ({ cwd, sha1, sha2, diff, diffFilter, filePatterns = [], isSubmo
|
|||||||
'--ignore-submodules=all',
|
'--ignore-submodules=all',
|
||||||
`--diff-filter=${diffFilter}`,
|
`--diff-filter=${diffFilter}`,
|
||||||
`${sha1}${diff}${sha2}`
|
`${sha1}${diff}${sha2}`
|
||||||
], { cwd });
|
], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
if (isSubmodule) {
|
if (isSubmodule) {
|
||||||
core.warning(stderr ||
|
core.warning(stderr ||
|
||||||
@ -1378,7 +1401,10 @@ const gitDiff = ({ cwd, sha1, sha2, diff, diffFilter, filePatterns = [], isSubmo
|
|||||||
});
|
});
|
||||||
exports.gitDiff = gitDiff;
|
exports.gitDiff = gitDiff;
|
||||||
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 { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['log', ...args], { cwd });
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['log', ...args], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
throw new Error(stderr || 'An unexpected error occurred');
|
throw new Error(stderr || 'An unexpected error occurred');
|
||||||
}
|
}
|
||||||
@ -1386,7 +1412,10 @@ const gitLog = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* ()
|
|||||||
});
|
});
|
||||||
exports.gitLog = gitLog;
|
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 { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['rev-parse', 'HEAD'], { cwd });
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['rev-parse', 'HEAD'], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
throw new Error(stderr || 'Unable to get HEAD sha');
|
throw new Error(stderr || 'Unable to get HEAD sha');
|
||||||
}
|
}
|
||||||
@ -1394,7 +1423,10 @@ const getHeadSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
|||||||
});
|
});
|
||||||
exports.getHeadSha = getHeadSha;
|
exports.getHeadSha = getHeadSha;
|
||||||
const getParentHeadSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getParentHeadSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['rev-parse', 'HEAD^'], { cwd });
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['rev-parse', 'HEAD^'], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
throw new Error(stderr || 'Unable to get HEAD^ sha');
|
throw new Error(stderr || 'Unable to get HEAD^ sha');
|
||||||
}
|
}
|
||||||
@ -1402,7 +1434,10 @@ const getParentHeadSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function
|
|||||||
});
|
});
|
||||||
exports.getParentHeadSha = getParentHeadSha;
|
exports.getParentHeadSha = getParentHeadSha;
|
||||||
const getBranchHeadSha = ({ branch, cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
const getBranchHeadSha = ({ branch, cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['rev-parse', branch], { cwd });
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['rev-parse', branch], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
throw new Error(stderr || `Unable to get ${branch} head sha`);
|
throw new Error(stderr || `Unable to get ${branch} head sha`);
|
||||||
}
|
}
|
||||||
@ -1410,7 +1445,10 @@ const getBranchHeadSha = ({ branch, cwd }) => __awaiter(void 0, void 0, void 0,
|
|||||||
});
|
});
|
||||||
exports.getBranchHeadSha = getBranchHeadSha;
|
exports.getBranchHeadSha = getBranchHeadSha;
|
||||||
const verifyCommitSha = ({ sha, cwd, showAsErrorMessage = true }) => __awaiter(void 0, void 0, void 0, function* () {
|
const verifyCommitSha = ({ sha, cwd, showAsErrorMessage = true }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['rev-parse', '--quiet', '--verify', `${sha}^{commit}`], { cwd });
|
const { exitCode, stderr } = yield exec.getExecOutput('git', ['rev-parse', '--quiet', '--verify', `${sha}^{commit}`], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
if (showAsErrorMessage) {
|
if (showAsErrorMessage) {
|
||||||
core.error(`Unable to locate the commit sha: ${sha}`);
|
core.error(`Unable to locate the commit sha: ${sha}`);
|
||||||
@ -1426,7 +1464,10 @@ const verifyCommitSha = ({ sha, cwd, showAsErrorMessage = true }) => __awaiter(v
|
|||||||
});
|
});
|
||||||
exports.verifyCommitSha = verifyCommitSha;
|
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 { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['tag', '--sort=-version:refname'], { cwd });
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['tag', '--sort=-version:refname'], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
throw new Error(stderr || 'Unable to get previous tag');
|
throw new Error(stderr || 'Unable to get previous tag');
|
||||||
}
|
}
|
||||||
@ -1436,7 +1477,10 @@ const getPreviousGitTag = ({ cwd }) => __awaiter(void 0, void 0, void 0, functio
|
|||||||
return { tag: '', sha: '' };
|
return { tag: '', sha: '' };
|
||||||
}
|
}
|
||||||
const previousTag = tags[1];
|
const previousTag = tags[1];
|
||||||
const { exitCode: exitCode2, stdout: stdout2, stderr: stderr2 } = yield exec.getExecOutput('git', ['rev-parse', previousTag], { cwd });
|
const { exitCode: exitCode2, stdout: stdout2, stderr: stderr2 } = yield exec.getExecOutput('git', ['rev-parse', previousTag], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
if (exitCode2 !== 0) {
|
if (exitCode2 !== 0) {
|
||||||
throw new Error(stderr2 || 'Unable to get previous tag');
|
throw new Error(stderr2 || 'Unable to get previous tag');
|
||||||
}
|
}
|
||||||
@ -1445,7 +1489,10 @@ const getPreviousGitTag = ({ cwd }) => __awaiter(void 0, void 0, void 0, functio
|
|||||||
});
|
});
|
||||||
exports.getPreviousGitTag = getPreviousGitTag;
|
exports.getPreviousGitTag = getPreviousGitTag;
|
||||||
const canDiffCommits = ({ cwd, sha1, sha2, diff }) => __awaiter(void 0, void 0, void 0, function* () {
|
const canDiffCommits = ({ cwd, sha1, sha2, diff }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['diff', '--name-only', '--ignore-submodules=all', `${sha1}${diff}${sha2}`], { cwd });
|
const { exitCode, stderr } = yield exec.getExecOutput('git', ['diff', '--name-only', '--ignore-submodules=all', `${sha1}${diff}${sha2}`], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
});
|
||||||
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}`);
|
||||||
return false;
|
return false;
|
||||||
|
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
93
src/utils.ts
93
src/utils.ts
@ -19,9 +19,11 @@ const versionToNumber = (version: string): number => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const verifyMinimumGitVersion = async (): Promise<void> => {
|
export const verifyMinimumGitVersion = async (): Promise<void> => {
|
||||||
const {exitCode, stdout, stderr} = await exec.getExecOutput('git', [
|
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||||
'--version'
|
'git',
|
||||||
])
|
['--version'],
|
||||||
|
{silent: true}
|
||||||
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
throw new Error(stderr || 'An unexpected error occurred')
|
throw new Error(stderr || 'An unexpected error occurred')
|
||||||
@ -143,7 +145,8 @@ export const updateGitGlobalConfig = async ({
|
|||||||
'git',
|
'git',
|
||||||
['config', '--global', name, value],
|
['config', '--global', name, value],
|
||||||
{
|
{
|
||||||
ignoreReturnCode: true
|
ignoreReturnCode: true,
|
||||||
|
silent: true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -157,7 +160,10 @@ export const isRepoShallow = async ({cwd}: {cwd: string}): Promise<boolean> => {
|
|||||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['rev-parse', '--is-shallow-repository'],
|
['rev-parse', '--is-shallow-repository'],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
@ -175,7 +181,10 @@ export const submoduleExists = async ({
|
|||||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['submodule', 'status'],
|
['submodule', 'status'],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
@ -195,7 +204,10 @@ export const gitFetch = async ({
|
|||||||
const {exitCode, stderr} = await exec.getExecOutput(
|
const {exitCode, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['fetch', ...args],
|
['fetch', ...args],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
/* istanbul ignore if */
|
/* istanbul ignore if */
|
||||||
@ -216,7 +228,10 @@ export const gitFetchSubmodules = async ({
|
|||||||
const {exitCode, stderr} = await exec.getExecOutput(
|
const {exitCode, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['submodule', 'foreach', 'git', 'fetch', ...args],
|
['submodule', 'foreach', 'git', 'fetch', ...args],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
/* istanbul ignore if */
|
/* istanbul ignore if */
|
||||||
@ -233,7 +248,10 @@ export const getSubmodulePath = async ({
|
|||||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['submodule', 'status'],
|
['submodule', 'status'],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
@ -263,7 +281,10 @@ export const gitSubmoduleDiffSHA = async ({
|
|||||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['diff', parentSha1, parentSha2, '--', submodulePath],
|
['diff', parentSha1, parentSha2, '--', submodulePath],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
@ -284,7 +305,7 @@ export const gitSubmoduleDiffSHA = async ({
|
|||||||
return {previousSha, currentSha}
|
return {previousSha, currentSha}
|
||||||
}
|
}
|
||||||
|
|
||||||
core.warning(
|
core.debug(
|
||||||
`No submodule commit found for ${submodulePath} between ${parentSha1}${diff}${parentSha2}`
|
`No submodule commit found for ${submodulePath} between ${parentSha1}${diff}${parentSha2}`
|
||||||
)
|
)
|
||||||
return {}
|
return {}
|
||||||
@ -314,7 +335,10 @@ export const gitRenamedFiles = async ({
|
|||||||
'--diff-filter=R',
|
'--diff-filter=R',
|
||||||
`${sha1}${diff}${sha2}`
|
`${sha1}${diff}${sha2}`
|
||||||
],
|
],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
@ -373,7 +397,10 @@ export const gitDiff = async ({
|
|||||||
`--diff-filter=${diffFilter}`,
|
`--diff-filter=${diffFilter}`,
|
||||||
`${sha1}${diff}${sha2}`
|
`${sha1}${diff}${sha2}`
|
||||||
],
|
],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
@ -418,7 +445,10 @@ export const gitLog = async ({
|
|||||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['log', ...args],
|
['log', ...args],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
@ -432,7 +462,10 @@ export const getHeadSha = async ({cwd}: {cwd: string}): Promise<string> => {
|
|||||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['rev-parse', 'HEAD'],
|
['rev-parse', 'HEAD'],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
@ -450,7 +483,10 @@ export const getParentHeadSha = async ({
|
|||||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['rev-parse', 'HEAD^'],
|
['rev-parse', 'HEAD^'],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
@ -470,7 +506,10 @@ export const getBranchHeadSha = async ({
|
|||||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['rev-parse', branch],
|
['rev-parse', branch],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
@ -492,7 +531,10 @@ export const verifyCommitSha = async ({
|
|||||||
const {exitCode, stderr} = await exec.getExecOutput(
|
const {exitCode, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['rev-parse', '--quiet', '--verify', `${sha}^{commit}`],
|
['rev-parse', '--quiet', '--verify', `${sha}^{commit}`],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
@ -519,7 +561,10 @@ export const getPreviousGitTag = async ({
|
|||||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['tag', '--sort=-version:refname'],
|
['tag', '--sort=-version:refname'],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
@ -539,7 +584,10 @@ export const getPreviousGitTag = async ({
|
|||||||
exitCode: exitCode2,
|
exitCode: exitCode2,
|
||||||
stdout: stdout2,
|
stdout: stdout2,
|
||||||
stderr: stderr2
|
stderr: stderr2
|
||||||
} = await exec.getExecOutput('git', ['rev-parse', previousTag], {cwd})
|
} = await exec.getExecOutput('git', ['rev-parse', previousTag], {
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
})
|
||||||
|
|
||||||
if (exitCode2 !== 0) {
|
if (exitCode2 !== 0) {
|
||||||
throw new Error(stderr2 || 'Unable to get previous tag')
|
throw new Error(stderr2 || 'Unable to get previous tag')
|
||||||
@ -564,7 +612,10 @@ export const canDiffCommits = async ({
|
|||||||
const {exitCode, stderr} = await exec.getExecOutput(
|
const {exitCode, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['diff', '--name-only', '--ignore-submodules=all', `${sha1}${diff}${sha2}`],
|
['diff', '--name-only', '--ignore-submodules=all', `${sha1}${diff}${sha2}`],
|
||||||
{cwd}
|
{
|
||||||
|
cwd,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user