Skip to content

Commit

Permalink
Merge pull request #51 from AikidoSec/fix/use-correct-startsWith
Browse files Browse the repository at this point in the history
Fix: use correct startsWith function on string
  • Loading branch information
willem-delbare authored May 10, 2024
2 parents cab786f + 8070af2 commit 47d83db
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4

- name: Detect new vulnerabilities
uses: AikidoSec/[email protected].12
uses: AikidoSec/[email protected].13
with:
secret-key: ${{ secrets.AIKIDO_SECRET_KEY }}
fail-on-timeout: true
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ async function run() {
core.info(`starting a scan with secret key: "${redactedToken}"`);
}
else {
const isLikelyDependabotPr = ((_8 = startScanPayload.branch_name) !== null && _8 !== void 0 ? _8 : '').starts_with('dependabot/');
const isLikelyDependabotPr = ((_8 = startScanPayload.branch_name) !== null && _8 !== void 0 ? _8 : '').startsWith('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);
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ 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/')
const isLikelyDependabotPr = (startScanPayload.branch_name ?? '').startsWith('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);
Expand Down

0 comments on commit 47d83db

Please sign in to comment.