Skip to content

Commit aa64dea

Browse files
use instefof instead of invalid contains
1 parent a06285d commit aa64dea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

danger/dangerfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ async function CheckFromExternalChecks() {
196196
const workspaceDir = '/github/workspace';
197197
const customPath = `${workspaceDir}${extraDangerFilePath}`;
198198

199-
if (extraDangerFilePath.contains(workspaceDir)) {
199+
if (extraDangerFilePath.indexOf('..') !== -1) {
200200
fail(`Invalid dangerfile path: ${customPath}. Path traversal is not allowed.`);
201201
return;
202202
}

0 commit comments

Comments
 (0)