Improve CodeQL action

* no need to run CodeQL on Dependabit PRs; no related files are changed there
* specify permissions
* enable `security-and-quality` rules instead of the default rules
* ignore `vendor` folders

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
XhmikosR
2025-03-07 08:39:05 +02:00
parent 5519b9d98c
commit 16dff4fdd1
2 changed files with 21 additions and 7 deletions

3
.github/codeql/codeql-config.yml vendored Normal file
View File

@@ -0,0 +1,3 @@
name: "CodeQL config"
paths-ignore:
- "**/vendor/**"

View File

@@ -7,29 +7,40 @@ on:
- development
- "!dependabot/**"
pull_request:
# The branches below must be a subset of the branches above
branches:
- master
- development
- "!dependabot/**"
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
- name: Clone repository
uses: actions/checkout@v4.2.2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.28.10
with:
config-file: ./.github/codeql/codeql-config.yml
languages: "javascript"
queries: +security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@v3.28.10
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v3.28.10
with:
category: "/language:javascript"