From b96c2c02820256853782523f9c2cba49edea0f1c Mon Sep 17 00:00:00 2001
From: temenuzhka-thede <temenuzhka.thede@docker.com>
Date: Tue, 24 Oct 2023 11:19:58 +0200
Subject: [PATCH] introduce CodeQL to enable SAST scanning

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: temenuzhka-thede <temenuzhka.thede@docker.com>
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
---
 .github/workflows/codeql.yml | 47 ++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 .github/workflows/codeql.yml

diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 0000000..1c54188
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,47 @@
+name: codeql
+
+on:
+  push:
+    branches:
+      - 'master'
+      - 'releases/v*'
+    paths:
+      - '.github/workflows/codeql.yml'
+      - 'dist/**'
+      - 'src/**'
+  pull_request:
+    paths:
+      - '.github/workflows/codeql.yml'
+      - 'dist/**'
+      - 'src/**'
+
+permissions:
+  actions: read
+  contents: read
+  security-events: write
+
+jobs:
+  analyze:
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        language:
+          - javascript-typescript
+    steps:
+      -
+        name: Checkout
+        uses: actions/checkout@v4
+      -
+        name: Initialize CodeQL
+        uses: github/codeql-action/init@v2
+        with:
+          languages: ${{ matrix.language }}
+      -
+        name: Autobuild
+        uses: github/codeql-action/autobuild@v2
+      -
+        name: Perform CodeQL Analysis
+        uses: github/codeql-action/analyze@v2
+        with:
+          category: "/language:${{matrix.language}}"