2022-12-11 23:46:30 +00: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-09-04 13:40:10 +00:00
|
|
|
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
|
2022-12-11 23:46:30 +00:00
|
|
|
- name: Scan with njsscan
|
|
|
|
id: njsscan
|
2023-05-14 04:31:20 +00:00
|
|
|
uses: ajinabraham/njsscan-action@74e5a58c1edb363b84c9ddd626b0e22f038ac09e # master
|
2022-12-11 23:46:30 +00:00
|
|
|
with:
|
|
|
|
args: '--sarif --output results.sarif src || true'
|
|
|
|
- name: Upload njsscan report
|
2023-09-17 19:51:45 +00:00
|
|
|
uses: github/codeql-action/upload-sarif@04daf014b50eaf774287bf3f0f1869d4b4c4b913 # v2.21.7
|
2022-12-11 23:46:30 +00: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-09-04 13:40:10 +00:00
|
|
|
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
|
2022-12-11 23:46:30 +00:00
|
|
|
|
|
|
|
- name: Initialize CodeQL
|
2023-09-17 19:51:45 +00:00
|
|
|
uses: github/codeql-action/init@04daf014b50eaf774287bf3f0f1869d4b4c4b913 # v2.21.7
|
2022-12-11 23:46:30 +00:00
|
|
|
with:
|
|
|
|
languages: ${{ matrix.language }}
|
|
|
|
queries: +security-and-quality
|
|
|
|
|
|
|
|
- name: Autobuild
|
2023-09-17 19:51:45 +00:00
|
|
|
uses: github/codeql-action/autobuild@04daf014b50eaf774287bf3f0f1869d4b4c4b913 # v2.21.7
|
2022-12-11 23:46:30 +00:00
|
|
|
|
|
|
|
- name: Perform CodeQL Analysis
|
2023-09-17 19:51:45 +00:00
|
|
|
uses: github/codeql-action/analyze@04daf014b50eaf774287bf3f0f1869d4b4c4b913 # v2.21.7
|
2022-12-11 23:46:30 +00:00
|
|
|
with:
|
|
|
|
category: "/language:${{ matrix.language }}"
|