From be8ff11cae4522219c11ec5236d4a9b326c4e038 Mon Sep 17 00:00:00 2001 From: naiba Date: Sun, 1 Mar 2026 03:32:32 +0000 Subject: [PATCH] fix: upgrade CodeQL Action to v3 and generate swagger docs before build - Upgrade github/codeql-action from v2 to v3 (v1/v2 deprecated) - Upgrade actions/setup-go from v4 to v5 - Add swag init step before autobuild to generate cmd/dashboard/docs package, fixing "could not import: invalid package name" warning Co-authored-by: naiba/CloudCode --- .github/workflows/codeql-analysis.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 656eecc..f2ce05d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -41,13 +41,13 @@ jobs: uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: go.mod # Initializes the CodeQL tools for scanning. - 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. @@ -55,10 +55,14 @@ jobs: # 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) + # Generate swagger docs before build (cmd/dashboard/docs is .gitignored) + - name: Generate swagger docs + run: | + go install github.com/swaggo/swag/cmd/swag@latest + swag init --pd -d . -g ./cmd/dashboard/main.go -o ./cmd/dashboard/docs --requiredByDefault + - 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 @@ -72,4 +76,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3