Skip to content

Commit edb45c7

Browse files
committed
Don't enforce that checkout path must be inside of Github Workspace
Fixes #327, Fixes #197. And i also hit this.
1 parent 5a4ac90 commit edb45c7

File tree

4 files changed

+2
-14
lines changed

4 files changed

+2
-14
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous
8282
# Default: true
8383
persist-credentials: ''
8484

85-
# Relative path under $GITHUB_WORKSPACE to place the repository
85+
# Path relative to $GITHUB_WORKSPACE to place the repository
8686
path: ''
8787

8888
# Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ inputs:
4949
description: 'Whether to configure the token or SSH key with the local git config'
5050
default: true
5151
path:
52-
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
52+
description: 'Path relative to $GITHUB_WORKSPACE to place the repository'
5353
clean:
5454
description: 'Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching'
5555
default: true

dist/index.js

-3
Original file line numberDiff line numberDiff line change
@@ -14537,9 +14537,6 @@ function getInputs() {
1453714537
// Repository path
1453814538
result.repositoryPath = core.getInput('path') || '.';
1453914539
result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
14540-
if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
14541-
throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
14542-
}
1454314540
// Workflow repository?
1454414541
const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
1454514542
`${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();

src/input-helper.ts

-9
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,6 @@ export function getInputs(): IGitSourceSettings {
4040
githubWorkspacePath,
4141
result.repositoryPath
4242
)
43-
if (
44-
!(result.repositoryPath + path.sep).startsWith(
45-
githubWorkspacePath + path.sep
46-
)
47-
) {
48-
throw new Error(
49-
`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`
50-
)
51-
}
5243

5344
// Workflow repository?
5445
const isWorkflowRepository =

0 commit comments

Comments
 (0)