From d88883328a8af1bd482c3b76c82055826e270609 Mon Sep 17 00:00:00 2001 From: Ryan Richard Date: Tue, 27 Feb 2024 12:02:59 -0800 Subject: [PATCH] Update codeql workflow actions to latest versions and add setup-go See deprecation of v2 message in README.md at https://github.com/github/codeql-action Added setup-go because codeql code scanning stopped working and gave this error message: The go.mod file requires version v1.21.3 of Go, but version v1.20.14 is installed. Consider adding an actions/setup-go step to your workflow. --- .github/workflows/codeql-analysis.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 96ac73e75..9b9b0b762 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -29,11 +29,13 @@ jobs: language: [ 'go', 'javascript' ] steps: + # Checkout our repository. + # See https://github.com/actions/checkout for documentation. - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -43,10 +45,16 @@ jobs: # For more details on CodeQL's query packs, refer to: 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 + # Install Go. + # See https://github.com/actions/setup-go?tab=readme-ov-file#getting-go-version-from-the-gomod-file. + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + # 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 + uses: github/codeql-action/autobuild@v3 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -59,6 +67,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}"