mirror of
https://github.com/actions/checkout.git
synced 2025-07-10 20:40:44 +00:00
enbl-4519 updating code to use relative paths that are parent paths of the workspace
This commit is contained in:
parent
25a956c84d
commit
e6a424882a
8 changed files with 13062 additions and 12835 deletions
|
@ -40,11 +40,12 @@ export function getInputs(): IGitSourceSettings {
|
|||
githubWorkspacePath,
|
||||
result.repositoryPath
|
||||
)
|
||||
if (
|
||||
!(result.repositoryPath + path.sep).startsWith(
|
||||
githubWorkspacePath + path.sep
|
||||
)
|
||||
) {
|
||||
|
||||
const allowParentPath = core.getInput('allow_parent_path')
|
||||
? core.getInput('allow_parent_path').toString().toLowerCase() === 'true'
|
||||
: false
|
||||
|
||||
if (!allowParentPath && !(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
|
||||
throw new Error(
|
||||
`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`
|
||||
)
|
||||
|
@ -114,6 +115,7 @@ export function getInputs(): IGitSourceSettings {
|
|||
result.sshStrict =
|
||||
(core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE'
|
||||
|
||||
|
||||
// Persist credentials
|
||||
result.persistCredentials =
|
||||
(core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue