From b1c05bfcf720139019856145d471bb824129b2f7 Mon Sep 17 00:00:00 2001 From: karim Goubbaa Date: Wed, 21 Aug 2024 11:24:10 +0200 Subject: [PATCH] fix(): use codeql v3 --- .../workflows/codeql-analysis-template.yml | 46 ++++++------------- .github/workflows/codeql-analysis.yml | 13 +----- 2 files changed, 15 insertions(+), 44 deletions(-) diff --git a/.github/workflows/codeql-analysis-template.yml b/.github/workflows/codeql-analysis-template.yml index 47dcc59fb..0dd6f075d 100644 --- a/.github/workflows/codeql-analysis-template.yml +++ b/.github/workflows/codeql-analysis-template.yml @@ -14,54 +14,34 @@ on: type: string required: true description: "Release if true" + build-mode: + type: string + required: false + default: autobuild + description: "The build mode that will be used to analyze the language" jobs: codeql-analyze: runs-on: ubuntu-latest permissions: - actions: read - contents: read + # required for all workflows security-events: write + # required to fetch internal or private CodeQL packs + packages: read steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 17 - cache: "maven" - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ inputs.language }} + build-mode: ${{ inputs.build-mode }} source-root: ${{ inputs.project-dir }} - # If you wish to specify custom queries, you can do so here or in a config file. - # 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. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - with: - working-directory: ${{ inputs.project-dir }} - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7663a57f6..52035a176 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,23 +1,13 @@ #SPDX-FileCopyrightText: 2017-2024 Enedis #SPDX-License-Identifier: Apache-2.0 -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# name: "CodeQL" on: push: branches: - main + - codeql paths-ignore: - 'docs/**' @@ -33,6 +23,7 @@ jobs: with: project-dir: chutney/ui language: javascript-typescript + build-mode: none dsl-analyze: uses: ./.github/workflows/codeql-analysis-template.yml