-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: repository root directory validation #3598
Conversation
// However we allow file paths to be outside of the build directory, since this | ||
// can be convenient in monorepo setups. | ||
const validateInsideRoot = function (originalPath, path, repositoryRoot, propName) { | ||
if (relative(repositoryRoot, path).startsWith('..') || getWindowsDrive(repositoryRoot) !== getWindowsDrive(path)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path.relative()
returns C:\\...
instead of ..\...
on Windows when the file paths are on different drives.
␊ | ||
[functions]␊ | ||
directory = "functions_dir"` | ||
Configuration property "functionsDirectory" "/external/path" must be inside the repository root directory.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation message changed.
@@ -1134,32 +1213,6 @@ Generated by [AVA](https://avajs.dev). | |||
"directory-two/**/*.jpg"␊ | |||
]` | |||
|
|||
## functions.included_files: does not contain paths outside of the root directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This specific property is checked and handled by zip-it-and-ship-it
instead.
Fixes #3431
Fixes netlify/zip-it-and-ship-it#609
This allows configuration file paths to target files outside of the
base
directory, providing they are inside the repository root directory.