Skip to content

Merge pull request #3781 from AlchemyCMS/dependabot/bun/rollup-57f76a… #4759

Merge pull request #3781 from AlchemyCMS/dependabot/bun/rollup-57f76a…

Merge pull request #3781 from AlchemyCMS/dependabot/bun/rollup-57f76a… #4759

# This workflow integrates Brakeman with GitHub's Code Scanning feature
# Brakeman is a static analysis security vulnerability scanner for Ruby on Rails applications
name: Brakeman Scan
concurrency:
group: brakeman-${{ github.ref_name }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
permissions:
contents: read
security-events: write
on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: "40 4 * * 2"
jobs:
check_bot_commit:
uses: ./.github/workflows/check-bot-commit.yml
brakeman-scan:
needs: [check_bot_commit]
if: needs.check_bot_commit.outputs.is_bot != 'true'
name: Brakeman Scan
runs-on: ubuntu-24.04
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v6
# Customize the ruby version depending on your needs
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
rubygems: "latest"
# Execute Brakeman CLI and generate a SARIF output with the security issues identified during the analysis
- name: Scan
run: |
bundle exec brakeman -f sarif -o output.sarif.json .
# Upload the SARIF file generated in the previous step
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v4
if: always()
with:
sarif_file: output.sarif.json
brakeman-success:
name: "Brakeman Success"
if: always()
needs: [check_bot_commit, brakeman-scan]
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check results
run: |
if [[ "${{ needs.brakeman-scan.result }}" != "success" && "${{ needs.brakeman-scan.result }}" != "skipped" ]]; then
echo "Failed: ${{ needs.brakeman-scan.result }}"
exit 1
fi