feat: add support for specifying the max number for retries to fetch missing history (#2052)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tonye Jack
2024-04-18 12:45:07 -06:00
committed by GitHub
parent 5bd333239b
commit 07c64e5618
8 changed files with 36 additions and 6 deletions

9
dist/index.js generated vendored
View File

@@ -1263,7 +1263,7 @@ const getSHAForPullRequestEvent = (_o) => __awaiter(void 0, [_o], void 0, functi
diff
}))) {
core.info('Merge base is not in the local history, fetching remote target branch...');
for (let i = 1; i <= 10; i++) {
for (let i = 1; i <= (inputs.fetchMissingHistoryMaxRetries || 10); i++) {
yield (0, utils_1.gitFetch)({
cwd: workingDirectory,
args: [
@@ -1375,7 +1375,8 @@ exports.DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS = {
skipInitialFetch: false,
fetchAdditionalSubmoduleHistory: false,
dirNamesDeletedFilesIncludeOnlyDeletedDirs: false,
excludeSubmodules: false
excludeSubmodules: false,
fetchMissingHistoryMaxRetries: 10
};
@@ -1593,6 +1594,7 @@ const getInputs = () => {
const excludeSubmodules = core.getBooleanInput('exclude_submodules', {
required: false
});
const fetchMissingHistoryMaxRetries = core.getInput('fetch_missing_history_max_retries', { required: false });
const inputs = {
files,
filesSeparator,
@@ -1656,6 +1658,9 @@ const getInputs = () => {
if (dirNamesMaxDepth) {
inputs.dirNamesMaxDepth = parseInt(dirNamesMaxDepth, 10);
}
if (fetchMissingHistoryMaxRetries) {
inputs.fetchMissingHistoryMaxRetries = parseInt(fetchMissingHistoryMaxRetries, 10);
}
return inputs;
};
exports.getInputs = getInputs;

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long