Skip to content

Commit

Permalink
Merge pull request #34 from AikidoSec/feat/show-message-on-dependabot-pr
Browse files Browse the repository at this point in the history
show message and early return when running on dependabot pr
  • Loading branch information
willem-delbare authored Feb 28, 2024
2 parents 101e7d4 + 1d8c18f commit 54dc298
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ async function run(): Promise<void> {
const redactedToken = '********************' + secretKey.slice(-4);
core.info(`starting a scan with secret key: "${redactedToken}"`);
}else{
const isLikelyDependabotPr = (startScanPayload.branch_name ?? '').starts_with('dependabot/')
if (isLikelyDependabotPr) {
core.info(`it looks like the action is running on a dependabot PR, this means that secret variables are not available in this context and thus we can not start a scan. Please see: https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/`);
core.setOutput('outcome', STATUS_SUCCEEDED);
return;
}

core.info(`secret key not set.`);
}

Expand Down

0 comments on commit 54dc298

Please sign in to comment.