Skip to content

Commit

Permalink
Add new yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
tomer-mobb committed Jan 18, 2024
1 parent 2981199 commit 858bd37
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/mobb-codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Mobb/CodeQL Fixer on pull requests
# This workflow defines the needed steps to run CodeQL on every pull request and pass the results to Mobb Fixer.
# This example utilizes CodeQL with JavaScript. For other languages, change the CodeQL language settings below.
#
# Secrets in use:
# MOBB_API_TOKEN - your mobb user credentials (autumatially set if you forked this repo via the Mobb app)
# GITHUB_TOKEN - automatically set by GitHub

name: "Mobb/CodeQL"

on:
pull_request:
branches: ["main"]

jobs:
scan-and-fix:
name: Scan with CodeQL and fix with Mobb
runs-on: 'ubuntu-latest'
timeout-minutes: 360
permissions:
pull-requests: write
statuses: write

strategy:
fail-fast: false
matrix:
language: ["javascript-typescript"]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
codeql_output_filename: ["javascript.sarif"]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
output: results

- name: Run Mobb on the findings and get fixes
if: always()
uses: mobb-dev/action/[email protected]
with:
report-file: results/${{ matrix.codeql_output_filename }}
api-key: ${{ secrets.MOBB_API_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
scanner: codeql

0 comments on commit 858bd37

Please sign in to comment.