Compare commits

...

3 commits

Author SHA1 Message Date
Xavier Solé Nogués
94808f1308
Merge d1d381abe7 into ff7abcd0c3 2025-08-15 02:48:30 +02:00
Salman Chishti
ff7abcd0c3
Update README to include Node.js 24 support details and requirements (#2248)
* Update README to include Node.js 24 support details and requirements

* Update
2025-08-13 13:57:25 +01:00
xavisolesoft
d1d381abe7 Implement allow-path-outside-workspace 2024-12-18 10:08:23 +01:00
4 changed files with 18 additions and 3 deletions

View file

@ -2,7 +2,11 @@
# Checkout V5
Checkout v5 now supports Node.js 24
## What's new
- Updated to the node24 runtime
- This requires a minimum Actions Runner version of [v2.327.1](https://github.com/actions/runner/releases/tag/v2.327.1) to run.
# Checkout V4
@ -96,6 +100,10 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
# Relative path under $GITHUB_WORKSPACE to place the repository
path: ''
# Allow the checked-out repository to be placed outside of the workspace
# Default: false
allow-path-outside-workspace: ''
# Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching
# Default: true
clean: ''
@ -154,9 +162,10 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
# Scenarios
- [Checkout V5](#checkout-v5)
- [What's new](#whats-new)
- [Checkout V4](#checkout-v4)
- [Note](#note)
- [What's new](#whats-new)
- [What's new](#whats-new-1)
- [Usage](#usage)
- [Scenarios](#scenarios)
- [Fetch only the root files](#fetch-only-the-root-files)

View file

@ -54,6 +54,10 @@ inputs:
default: true
path:
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
allow-path-outside-workspace:
description: Allow the checked-out repository to be placed outside of the workspace.
default: false
required: false
clean:
description: 'Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching'
default: true

3
dist/index.js vendored
View file

@ -1737,7 +1737,8 @@ function getInputs() {
// Repository path
result.repositoryPath = core.getInput('path') || '.';
result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
if (!core.getInput('allow-path-outside-workspace') &&
!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
}
// Workflow repository?

View file

@ -42,6 +42,7 @@ export async function getInputs(): Promise<IGitSourceSettings> {
result.repositoryPath
)
if (
!core.getInput('allow-path-outside-workspace') &&
!(result.repositoryPath + path.sep).startsWith(
githubWorkspacePath + path.sep
)