From b2764574901bbd9be5b0bbc928606eeb53134399 Mon Sep 17 00:00:00 2001 From: Defined Prototype <5364018+graycraft@users.noreply.github.com> Date: Sat, 5 Apr 2025 18:52:18 +0500 Subject: [PATCH] ci(.github/workflows/codeql-scan.yml): add workflow for CodeQL scan --- .github/workflows/codeql-scan.yml | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/codeql-scan.yml diff --git a/.github/workflows/codeql-scan.yml b/.github/workflows/codeql-scan.yml new file mode 100644 index 000000000..fdb2d4cff --- /dev/null +++ b/.github/workflows/codeql-scan.yml @@ -0,0 +1,54 @@ +name: CodeQL Scan + +on: + push: + branches: + - master + - dev + pull_request: + types: + - opened + workflow_dispatch: + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # @see https://gh.io/recommended-hardware-resources-for-running-codeql + # @see https://gh.io/supported-runners-and-hardware-resources + # @see https://gh.io/using-larger-runners + runs-on: ubuntu-latest + permissions: + # Required for all workflows. + security-events: write + # Required to fetch internal or private CodeQL packs. + packages: read + # Only required for workflows in private repositories. + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + # @see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # @see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + build-mode: ['none'] + language: ['actions', 'javascript-typescript'] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # @see https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + queries: security-extended,security-and-quality + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: '/language:${{matrix.language}}'