Skip to content

Commit 3266321

Browse files
committed
add error
1 parent 4d5bcd1 commit 3266321

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/scanners/diffScan.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ async function scanDiff({
1414

1515
const commitSha = process.env.GITHUB_SHA;
1616

17+
if (!commitSha) {
18+
throw new Error('No GitHub commit SHA found, exiting with error');
19+
}
20+
1721
const git = simpleGit(repoPath);
1822

1923
const diffResult = await git.diff([`${commitSha}^..${commitSha}`, '--name-status', '-M']);

0 commit comments

Comments
 (0)