mirror of
https://github.com/actions/checkout.git
synced 2026-06-20 17:34:08 +08:00
Compare commits
1 Commits
af6092afbf
...
v6.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1af3b93b68 |
@@ -1,8 +1,17 @@
|
||||
# Changelog
|
||||
|
||||
## V6.0.0
|
||||
* Persist creds to a separate file by @ericsciple in https://github.com/actions/checkout/pull/2286
|
||||
* Update README to include Node.js 24 support details and requirements by @salmanmkc in https://github.com/actions/checkout/pull/2248
|
||||
|
||||
## V5.0.1
|
||||
* Port v6 cleanup to v5 by @ericsciple in https://github.com/actions/checkout/pull/2301
|
||||
|
||||
## V5.0.0
|
||||
* Update actions checkout to use node 24 by @salmanmkc in https://github.com/actions/checkout/pull/2226
|
||||
|
||||
## V4.3.1
|
||||
* Port v6 cleanup to v4 by @ericsciple in https://github.com/actions/checkout/pull/2305
|
||||
|
||||
## V4.3.0
|
||||
* docs: update README.md by @motss in https://github.com/actions/checkout/pull/1971
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[](https://github.com/actions/checkout/actions/workflows/test.yml)
|
||||
|
||||
# Checkout v6-beta
|
||||
# Checkout v6
|
||||
|
||||
## What's new
|
||||
|
||||
@@ -128,9 +128,6 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
|
||||
# Default: 1
|
||||
fetch-depth: ''
|
||||
|
||||
# Date like `2days` or `1970-01-01`. Fetch a history after the specified time.
|
||||
shallow-since: ''
|
||||
|
||||
# Whether to fetch tags, even if fetch-depth > 0.
|
||||
# Default: false
|
||||
fetch-tags: ''
|
||||
|
||||
@@ -1157,7 +1157,6 @@ async function setup(testName: string): Promise<void> {
|
||||
sparseCheckout: [],
|
||||
sparseCheckoutConeMode: true,
|
||||
fetchDepth: 1,
|
||||
shallowSince: '',
|
||||
fetchTags: false,
|
||||
showProgress: true,
|
||||
lfs: false,
|
||||
|
||||
@@ -74,8 +74,6 @@ inputs:
|
||||
fetch-depth:
|
||||
description: 'Number of commits to fetch. 0 indicates all history for all branches and tags.'
|
||||
default: 1
|
||||
shallow-since:
|
||||
description: 'Date like `2days` or `1970-01-01`. Fetch a history after the specified time.'
|
||||
fetch-tags:
|
||||
description: 'Whether to fetch tags, even if fetch-depth > 0.'
|
||||
default: false
|
||||
|
||||
@@ -72,8 +72,6 @@ We want to take this opportunity to make behavioral changes, from v1. This docum
|
||||
fetch-depth:
|
||||
description: 'Number of commits to fetch. 0 indicates all history for all tags and branches.'
|
||||
default: 1
|
||||
shallow-since:
|
||||
description: 'Date like `2days` or `1970-01-01`. Fetch a history after the specified time.'
|
||||
lfs:
|
||||
description: 'Whether to download Git-LFS files'
|
||||
default: false
|
||||
@@ -157,7 +155,7 @@ Fetch only the SHA being built and set depth=1. This significantly reduces the f
|
||||
|
||||
If a SHA isn't available (e.g. multi repo), then fetch only the specified ref with depth=1.
|
||||
|
||||
The input `fetch-depth` and `shallow-since` can be used to control the depth.
|
||||
The input `fetch-depth` can be used to control the depth.
|
||||
|
||||
Note:
|
||||
- Fetching a single commit is supported by Git wire protocol version 2. The git client uses protocol version 0 by default. The desired protocol version can be overridden in the git config or on the fetch command line invocation (`-c protocol.version=2`). We will override on the fetch command line, for transparency.
|
||||
|
||||
14
dist/index.js
vendored
14
dist/index.js
vendored
@@ -835,9 +835,6 @@ 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}`);
|
||||
}
|
||||
@@ -978,16 +975,13 @@ class GitCommandManager {
|
||||
yield this.execGit(args);
|
||||
});
|
||||
}
|
||||
submoduleUpdate(fetchDepth, recursive, shallowSince) {
|
||||
submoduleUpdate(fetchDepth, recursive) {
|
||||
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');
|
||||
}
|
||||
@@ -2029,12 +2023,6 @@ 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';
|
||||
|
||||
@@ -37,7 +37,6 @@ export interface IGitCommandManager {
|
||||
options: {
|
||||
filter?: string
|
||||
fetchDepth?: number
|
||||
shallowSince?: string
|
||||
fetchTags?: boolean
|
||||
showProgress?: boolean
|
||||
}
|
||||
@@ -57,12 +56,8 @@ export interface IGitCommandManager {
|
||||
shaExists(sha: string): Promise<boolean>
|
||||
submoduleForeach(command: string, recursive: boolean): Promise<string>
|
||||
submoduleSync(recursive: boolean): Promise<void>
|
||||
submoduleUpdate(fetchDepth: number, recursive: boolean): Promise<void>
|
||||
submoduleStatus(): Promise<boolean>
|
||||
submoduleUpdate(
|
||||
fetchDepth: number,
|
||||
recursive: boolean,
|
||||
shallowSince?: string
|
||||
): Promise<void>
|
||||
tagExists(pattern: string): Promise<boolean>
|
||||
tryClean(): Promise<boolean>
|
||||
tryConfigUnset(configKey: string, globalConfig?: boolean): Promise<boolean>
|
||||
@@ -285,7 +280,6 @@ class GitCommandManager {
|
||||
options: {
|
||||
filter?: string
|
||||
fetchDepth?: number
|
||||
shallowSince?: string
|
||||
fetchTags?: boolean
|
||||
showProgress?: boolean
|
||||
}
|
||||
@@ -304,10 +298,6 @@ class GitCommandManager {
|
||||
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}`)
|
||||
} else if (
|
||||
@@ -458,21 +448,13 @@ class GitCommandManager {
|
||||
await this.execGit(args)
|
||||
}
|
||||
|
||||
async submoduleUpdate(
|
||||
fetchDepth: number,
|
||||
recursive: boolean,
|
||||
shallowSince?: string
|
||||
): Promise<void> {
|
||||
async submoduleUpdate(fetchDepth: number, recursive: boolean): Promise<void> {
|
||||
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')
|
||||
}
|
||||
|
||||
@@ -50,12 +50,7 @@ export interface IGitSourceSettings {
|
||||
fetchDepth: number
|
||||
|
||||
/**
|
||||
* Deepen or shorten the history of a shallow repository to include all reachable commits after
|
||||
*/
|
||||
shallowSince: string
|
||||
|
||||
/**
|
||||
* Fetch tags, even if fetchDepth > 0 (default: false)
|
||||
* Fetch tags, even if fetchDepth > 0 (default: false)
|
||||
*/
|
||||
fetchTags: boolean
|
||||
|
||||
|
||||
@@ -108,15 +108,6 @@ export async function getInputs(): Promise<IGitSourceSettings> {
|
||||
}
|
||||
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'
|
||||
|
||||
Reference in New Issue
Block a user