diff --git a/.github/configs/codeql-config.yml b/.github/configs/codeql-config.yml new file mode 100644 index 0000000..fd75cce --- /dev/null +++ b/.github/configs/codeql-config.yml @@ -0,0 +1,5 @@ +name: "CodeQL config" + +paths-ignore: + # Ignore files from third-party packages, e.g. Swagger + - backend/python/app/static diff --git a/.github/workflows/code-analysis.yml b/.github/workflows/code-analysis.yml new file mode 100644 index 0000000..dc9cfa4 --- /dev/null +++ b/.github/workflows/code-analysis.yml @@ -0,0 +1,42 @@ +name: "Code Analysis" + +on: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + # Scheduled workflows run on the latest commit on the default or base branch. + # The shortest interval you can run scheduled workflows is once every 15 minutes. + # ┌───────────── minute (0 - 59) + # │ ┌───────────── hour (0 - 23) + # │ │ ┌───────────── day of the month (1 - 31) + # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) + # │ │ │ │ │ + # │ │ │ │ │ + # │ │ │ │ │ + # * * * * * + - cron: '0 0 * * 0' + +jobs: + codeql-scan: + runs-on: ubuntu-latest + permissions: + security-events: write + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + # CodeQL supports the following languages: go, javascript, csharp, python, cpp, java. + # Select javascript for typescript + with: + languages: javascript, python + config-file: ./.github/configs/codeql-config.yml + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1