2022-12-11 18:46:30 -05:00
|
|
|
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
name: Static Analysis
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ develop ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ develop ]
|
|
|
|
schedule:
|
|
|
|
- cron: '0 7 * * 6'
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
actions: read
|
|
|
|
contents: read
|
|
|
|
security-events: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
njsscan:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Njsscan code scanning
|
|
|
|
steps:
|
|
|
|
- name: Checkout the code
|
2023-03-24 07:12:07 -04:00
|
|
|
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
|
2022-12-11 18:46:30 -05:00
|
|
|
- name: Scan with njsscan
|
|
|
|
id: njsscan
|
|
|
|
uses: ajinabraham/njsscan-action@d58d8b2f26322cd35a9efb8003baac517f226d81 # master
|
|
|
|
with:
|
|
|
|
args: '--sarif --output results.sarif src || true'
|
|
|
|
- name: Upload njsscan report
|
2023-04-06 15:37:38 -04:00
|
|
|
uses: github/codeql-action/upload-sarif@d186a2a36cc67bfa1b860e6170d37fb9634742c7 # v2.2.11
|
2022-12-11 18:46:30 -05:00
|
|
|
with:
|
|
|
|
sarif_file: results.sarif
|
|
|
|
|
|
|
|
codeql:
|
|
|
|
name: CodeQL analysis
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
language: [ 'javascript' ]
|
|
|
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-03-24 07:12:07 -04:00
|
|
|
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
|
2022-12-11 18:46:30 -05:00
|
|
|
|
|
|
|
- name: Initialize CodeQL
|
2023-04-06 15:37:38 -04:00
|
|
|
uses: github/codeql-action/init@d186a2a36cc67bfa1b860e6170d37fb9634742c7 # v2.2.11
|
2022-12-11 18:46:30 -05:00
|
|
|
with:
|
|
|
|
languages: ${{ matrix.language }}
|
|
|
|
queries: +security-and-quality
|
|
|
|
|
|
|
|
- name: Autobuild
|
2023-04-06 15:37:38 -04:00
|
|
|
uses: github/codeql-action/autobuild@d186a2a36cc67bfa1b860e6170d37fb9634742c7 # v2.2.11
|
2022-12-11 18:46:30 -05:00
|
|
|
|
|
|
|
- name: Perform CodeQL Analysis
|
2023-04-06 15:37:38 -04:00
|
|
|
uses: github/codeql-action/analyze@d186a2a36cc67bfa1b860e6170d37fb9634742c7 # v2.2.11
|
2022-12-11 18:46:30 -05:00
|
|
|
with:
|
|
|
|
category: "/language:${{ matrix.language }}"
|