From 04c690c7500653ecd7b8bf80ccdcc9dd54101555 Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Mon, 16 Jun 2025 03:30:13 +0400 Subject: [PATCH] build: run codeql before build --- .github/workflows/codeql.yml | 61 +++++++++++++++++++++++++++ .github/workflows/lint-js.yml | 2 +- .github/workflows/release.yml | 5 +++ .github/workflows/rolling-release.yml | 5 +++ 4 files changed, 72 insertions(+), 1 deletion(-) 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..cf4e1cd --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,61 @@ +name: "CodeQL" + +on: + workflow_call: + push: + branches: ["main"] + pull_request: + branches: ["main"] + schedule: + - cron: "16 13 * * 5" + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + security-events: write + packages: read + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: actions + build-mode: none + - language: javascript-typescript + build-mode: none + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up pnpm package manager + uses: pnpm/action-setup@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: "pnpm" + + - name: Install dependencies from lockfile + run: pnpm install --frozen-lockfile + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + queries: security-extended + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + + - if: matrix.build-mode == 'manual' + shell: bash + run: | + pnpm run build + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/lint-js.yml b/.github/workflows/lint-js.yml index f61e28e..ed64a9e 100644 --- a/.github/workflows/lint-js.yml +++ b/.github/workflows/lint-js.yml @@ -36,7 +36,7 @@ jobs: - name: Set up pnpm package manager uses: pnpm/action-setup@v4 - - name: Set up Node.js v22 + - name: Set up Node.js uses: actions/setup-node@v4 with: node-version-file: .node-version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cd12503..277a145 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,6 +37,11 @@ jobs: uses: ./.github/workflows/lint-rs.yml secrets: inherit + codeql: + name: CodeQL + uses: ./.github/workflows/codeql.yml + secrets: inherit + release: needs: [security-scan, lint-js, lint-rust] permissions: diff --git a/.github/workflows/rolling-release.yml b/.github/workflows/rolling-release.yml index 2e04148..83cabe1 100644 --- a/.github/workflows/rolling-release.yml +++ b/.github/workflows/rolling-release.yml @@ -36,6 +36,11 @@ jobs: uses: ./.github/workflows/lint-rs.yml secrets: inherit + codeql: + name: CodeQL + uses: ./.github/workflows/codeql.yml + secrets: inherit + rolling-release: needs: [security-scan, lint-js, lint-rust] permissions: