mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-08-14 17:30:50 +00:00
Merge 2449f8bb0b
into 08c6903cd8
This commit is contained in:
commit
982990b71c
8 changed files with 57 additions and 5 deletions
14
dist/index.js
vendored
14
dist/index.js
vendored
|
@ -663,6 +663,9 @@ class GitCommandManager {
|
|||
if (options.filter) {
|
||||
args.push(`--filter=${options.filter}`);
|
||||
}
|
||||
if (options.shallowSince) {
|
||||
args.push(`--shallow-since=${options.shallowSince}`);
|
||||
}
|
||||
if (options.fetchDepth && options.fetchDepth > 0) {
|
||||
args.push(`--depth=${options.fetchDepth}`);
|
||||
}
|
||||
|
@ -793,13 +796,16 @@ class GitCommandManager {
|
|||
yield this.execGit(args);
|
||||
});
|
||||
}
|
||||
submoduleUpdate(fetchDepth, recursive) {
|
||||
submoduleUpdate(fetchDepth, recursive, shallowSince) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const args = ['-c', 'protocol.version=2'];
|
||||
args.push('submodule', 'update', '--init', '--force');
|
||||
if (fetchDepth > 0) {
|
||||
args.push(`--depth=${fetchDepth}`);
|
||||
}
|
||||
if (shallowSince) {
|
||||
args.push(`--shallow-since=${shallowSince}`);
|
||||
}
|
||||
if (recursive) {
|
||||
args.push('--recursive');
|
||||
}
|
||||
|
@ -1787,6 +1793,12 @@ function getInputs() {
|
|||
result.fetchDepth = 0;
|
||||
}
|
||||
core.debug(`fetch depth = ${result.fetchDepth}`);
|
||||
// Shallow since
|
||||
if (core.getInput('fetch-depth') && core.getInput('shallow-since')) {
|
||||
throw new Error('`fetch-depth` and `shallow-since` cannot be used at the same time');
|
||||
}
|
||||
result.shallowSince = core.getInput('shallow-since');
|
||||
core.debug(`shallow since = ${result.shallowSince}`);
|
||||
// Fetch tags
|
||||
result.fetchTags =
|
||||
(core.getInput('fetch-tags') || 'false').toUpperCase() === 'TRUE';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue