We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18f9f59 commit a06285dCopy full SHA for a06285d
danger/dangerfile.js
@@ -193,13 +193,13 @@ async function CheckFromExternalChecks() {
193
console.log(`::debug:: Checking from external checks: ${extraDangerFilePath}`);
194
if (extraDangerFilePath) {
195
try {
196
+ const workspaceDir = '/github/workspace';
197
+ const customPath = `${workspaceDir}${extraDangerFilePath}`;
198
+
199
if (extraDangerFilePath.contains(workspaceDir)) {
200
fail(`Invalid dangerfile path: ${customPath}. Path traversal is not allowed.`);
201
return;
- }
-
- const workspaceDir = '/github/workspace';
202
- const customPath = `${workspaceDir}${extraDangerFilePath}`;
+ }
203
204
const extraModule = require(customPath);
205
if (typeof extraModule !== 'function') {
0 commit comments