mirror of
https://github.com/actions/checkout.git
synced 2024-11-23 01:22:50 +00:00
Don't enforce that checkout path must be inside of Github Workspace
Fixes #327, Fixes #197. And i also hit this.
This commit is contained in:
parent
5a4ac9002d
commit
edb45c76ac
4 changed files with 2 additions and 14 deletions
|
@ -82,7 +82,7 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous
|
|||
# Default: true
|
||||
persist-credentials: ''
|
||||
|
||||
# Relative path under $GITHUB_WORKSPACE to place the repository
|
||||
# Path relative to $GITHUB_WORKSPACE to place the repository
|
||||
path: ''
|
||||
|
||||
# Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching
|
||||
|
|
|
@ -49,7 +49,7 @@ inputs:
|
|||
description: 'Whether to configure the token or SSH key with the local git config'
|
||||
default: true
|
||||
path:
|
||||
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
|
||||
description: 'Path relative to $GITHUB_WORKSPACE to place the repository'
|
||||
clean:
|
||||
description: 'Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching'
|
||||
default: true
|
||||
|
|
3
dist/index.js
vendored
3
dist/index.js
vendored
|
@ -14537,9 +14537,6 @@ 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)) {
|
||||
throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
|
||||
}
|
||||
// Workflow repository?
|
||||
const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
|
||||
`${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
|
||||
|
|
|
@ -40,15 +40,6 @@ export function getInputs(): IGitSourceSettings {
|
|||
githubWorkspacePath,
|
||||
result.repositoryPath
|
||||
)
|
||||
if (
|
||||
!(result.repositoryPath + path.sep).startsWith(
|
||||
githubWorkspacePath + path.sep
|
||||
)
|
||||
) {
|
||||
throw new Error(
|
||||
`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`
|
||||
)
|
||||
}
|
||||
|
||||
// Workflow repository?
|
||||
const isWorkflowRepository =
|
||||
|
|
Loading…
Reference in a new issue