Skip to content

Commit

Permalink
Run code scanner from main workflow (#3073)
Browse files Browse the repository at this point in the history
This updates the code scanner workflow to run from the main workflow,
instead of a separate workflow.
  • Loading branch information
Mrtenz authored Feb 6, 2025
1 parent eebe356 commit cc5cc01
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ jobs:
run: ${{ steps.download-actionlint.outputs.executable }} -color
shell: bash

analyse-code:
name: Code scanner
needs: check-workflows
uses: ./.github/workflows/security-code-scanner.yml
permissions:
actions: read
contents: read
security-events: write
secrets:
SECURITY_SCAN_METRICS_TOKEN: ${{ secrets.SECURITY_SCAN_METRICS_TOKEN }}
APPSEC_BOT_SLACK_WEBHOOK: ${{ secrets.APPSEC_BOT_SLACK_WEBHOOK }}

update-pull-request:
name: Update pull request
needs: check-workflows
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/security-code-scanner.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
name: 'MetaMask Security Code Scanner'

on:
push:
branches: ['main']
pull_request:
workflow_call:
secrets:
SECURITY_SCAN_METRICS_TOKEN:
required: false
APPSEC_BOT_SLACK_WEBHOOK:
required: false

jobs:
run-security-scan:
name: Run security scan
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: MetaMask Security Code Scanner
- name: Analyse code
uses: MetaMask/Security-Code-Scanner@main
with:
repo: ${{ github.repository }}
Expand All @@ -31,5 +35,5 @@ jobs:
'**/jest.environment.js'
'**/jest.config.js'
node_modules
project_metrics_token: ${{secrets.SECURITY_SCAN_METRICS_TOKEN}}
project_metrics_token: ${{ secrets.SECURITY_SCAN_METRICS_TOKEN }}
slack_webhook: ${{ secrets.APPSEC_BOT_SLACK_WEBHOOK }}

0 comments on commit cc5cc01

Please sign in to comment.