From cc4fead714532424ab15b501a01d18c7f34d17e2 Mon Sep 17 00:00:00 2001 From: nickfyson Date: Thu, 7 Dec 2023 15:44:56 +0000 Subject: [PATCH] update version in various hardcoded locations --- src/autobuild.ts | 6 +-- src/codeql.ts | 2 +- src/init-action-post-helper.test.ts | 24 ++++++------ src/workflow.test.ts | 58 ++++++++++++++--------------- 4 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/autobuild.ts b/src/autobuild.ts index bf44462386..f2d78f256b 100644 --- a/src/autobuild.ts +++ b/src/autobuild.ts @@ -38,11 +38,11 @@ export async function determineAutobuildLanguages( * For example, consider a user with the following workflow file: * * ```yml - * - uses: github/codeql-action/init@v2 + * - uses: github/codeql-action/init@v3 * with: * languages: go, java - * - uses: github/codeql-action/autobuild@v2 - * - uses: github/codeql-action/analyze@v2 + * - uses: github/codeql-action/autobuild@v3 + * - uses: github/codeql-action/analyze@v3 * ``` * * - With Go extraction disabled, we will run the Java autobuilder in the diff --git a/src/codeql.ts b/src/codeql.ts index e2883f315a..05898134ed 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -1159,7 +1159,7 @@ export async function getCodeQLForCmd( "version of the CLI using the 'tools' input to the 'init' Action, you can remove this " + "input to use the default version.\n\n" + "Alternatively, if you want to continue using CodeQL CLI version " + - `${result.version}, you can replace 'github/codeql-action/*@v2' by ` + + `${result.version}, you can replace 'github/codeql-action/*@v3' by ` + `'github/codeql-action/*@v${getActionVersion()}' in your code scanning workflow to ` + "continue using this version of the CodeQL Action.", ); diff --git a/src/init-action-post-helper.test.ts b/src/init-action-post-helper.test.ts index bebfe0bc28..eff20f27c4 100644 --- a/src/init-action-post-helper.test.ts +++ b/src/init-action-post-helper.test.ts @@ -91,14 +91,14 @@ test("uploads failed SARIF run with `diagnostics export` if feature flag is off" }, { name: "Initialize CodeQL", - uses: "github/codeql-action/init@v2", + uses: "github/codeql-action/init@v3", with: { languages: "javascript", }, }, { name: "Perform CodeQL Analysis", - uses: "github/codeql-action/analyze@v2", + uses: "github/codeql-action/analyze@v3", with: { category: "my-category", }, @@ -115,14 +115,14 @@ test("uploads failed SARIF run with `diagnostics export` if the database doesn't }, { name: "Initialize CodeQL", - uses: "github/codeql-action/init@v2", + uses: "github/codeql-action/init@v3", with: { languages: "javascript", }, }, { name: "Perform CodeQL Analysis", - uses: "github/codeql-action/analyze@v2", + uses: "github/codeql-action/analyze@v3", with: { category: "my-category", }, @@ -142,14 +142,14 @@ test("uploads failed SARIF run with database export-diagnostics if the database }, { name: "Initialize CodeQL", - uses: "github/codeql-action/init@v2", + uses: "github/codeql-action/init@v3", with: { languages: "javascript", }, }, { name: "Perform CodeQL Analysis", - uses: "github/codeql-action/analyze@v2", + uses: "github/codeql-action/analyze@v3", with: { category: "my-category", }, @@ -199,14 +199,14 @@ for (const { uploadInput, shouldUpload } of UPLOAD_INPUT_TEST_CASES) { }, { name: "Initialize CodeQL", - uses: "github/codeql-action/init@v2", + uses: "github/codeql-action/init@v3", with: { languages: "javascript", }, }, { name: "Perform CodeQL Analysis", - uses: "github/codeql-action/analyze@v2", + uses: "github/codeql-action/analyze@v3", with: { category: "my-category", upload: uploadInput, @@ -234,14 +234,14 @@ test("uploading failed SARIF run succeeds when workflow uses an input with a mat }, { name: "Initialize CodeQL", - uses: "github/codeql-action/init@v2", + uses: "github/codeql-action/init@v3", with: { languages: "javascript", }, }, { name: "Perform CodeQL Analysis", - uses: "github/codeql-action/analyze@v2", + uses: "github/codeql-action/analyze@v3", with: { category: "/language:${{ matrix.language }}", }, @@ -261,14 +261,14 @@ test("uploading failed SARIF run fails when workflow uses a complex upload input }, { name: "Initialize CodeQL", - uses: "github/codeql-action/init@v2", + uses: "github/codeql-action/init@v3", with: { languages: "javascript", }, }, { name: "Perform CodeQL Analysis", - uses: "github/codeql-action/analyze@v2", + uses: "github/codeql-action/analyze@v3", with: { upload: "${{ matrix.language != 'csharp' }}", }, diff --git a/src/workflow.test.ts b/src/workflow.test.ts index dbba412ab3..688b34b00f 100644 --- a/src/workflow.test.ts +++ b/src/workflow.test.ts @@ -396,9 +396,9 @@ async function testLanguageAliases( }, }, steps: [ - { uses: "actions/checkout@v2" }, - { uses: "github/codeql-action/init@v2" }, - { uses: "github/codeql-action/analyze@v2" }, + { uses: "actions/checkout@v3" }, + { uses: "github/codeql-action/init@v3" }, + { uses: "github/codeql-action/analyze@v3" }, ], }, }, @@ -516,11 +516,11 @@ test("getWorkflowErrors() should only report the current job's CheckoutWrongHead test: steps: - run: "git checkout HEAD^2" - + test2: steps: - run: "git checkout HEAD^2" - + test3: steps: [] `) as Workflow, @@ -546,11 +546,11 @@ test("getWorkflowErrors() should not report a different job's CheckoutWrongHead" test: steps: - run: "git checkout HEAD^2" - + test2: steps: - run: "git checkout HEAD^2" - + test3: steps: [] `) as Workflow, @@ -652,9 +652,9 @@ test("getCategoryInputOrThrow returns category for simple workflow with category analysis: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: github/codeql-action/init@v2 - - uses: github/codeql-action/analyze@v2 + - uses: actions/checkout@v3 + - uses: github/codeql-action/init@v3 + - uses: github/codeql-action/analyze@v3 with: category: some-category `) as Workflow, @@ -674,9 +674,9 @@ test("getCategoryInputOrThrow returns undefined for simple workflow without cate analysis: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: github/codeql-action/init@v2 - - uses: github/codeql-action/analyze@v2 + - uses: actions/checkout@v3 + - uses: github/codeql-action/init@v3 + - uses: github/codeql-action/analyze@v3 `) as Workflow, "analysis", {}, @@ -694,19 +694,19 @@ test("getCategoryInputOrThrow returns category for workflow with multiple jobs", foo: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: github/codeql-action/init@v2 + - uses: actions/checkout@v3 + - uses: github/codeql-action/init@v3 - runs: ./build foo - - uses: github/codeql-action/analyze@v2 + - uses: github/codeql-action/analyze@v3 with: category: foo-category bar: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: github/codeql-action/init@v2 + - uses: actions/checkout@v3 + - uses: github/codeql-action/init@v3 - runs: ./build bar - - uses: github/codeql-action/analyze@v2 + - uses: github/codeql-action/analyze@v3 with: category: bar-category `) as Workflow, @@ -729,11 +729,11 @@ test("getCategoryInputOrThrow finds category for workflow with language matrix", matrix: language: [javascript, python] steps: - - uses: actions/checkout@v2 - - uses: github/codeql-action/init@v2 + - uses: actions/checkout@v3 + - uses: github/codeql-action/init@v3 with: language: \${{ matrix.language }} - - uses: github/codeql-action/analyze@v2 + - uses: github/codeql-action/analyze@v3 with: category: "/language:\${{ matrix.language }}" `) as Workflow, @@ -753,9 +753,9 @@ test("getCategoryInputOrThrow throws error for workflow with dynamic category", jobs: analysis: steps: - - uses: actions/checkout@v2 - - uses: github/codeql-action/init@v2 - - uses: github/codeql-action/analyze@v2 + - uses: actions/checkout@v3 + - uses: github/codeql-action/init@v3 + - uses: github/codeql-action/analyze@v3 with: category: "\${{ github.workflow }}" `) as Workflow, @@ -780,12 +780,12 @@ test("getCategoryInputOrThrow throws error for workflow with multiple calls to a analysis: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: github/codeql-action/init@v2 - - uses: github/codeql-action/analyze@v2 + - uses: actions/checkout@v3 + - uses: github/codeql-action/init@v3 + - uses: github/codeql-action/analyze@v3 with: category: some-category - - uses: github/codeql-action/analyze@v2 + - uses: github/codeql-action/analyze@v3 with: category: another-category `) as Workflow,