ci: add custom CodeQL workflow for backend/ Go module#17
Merged
Conversation
Default CodeQL setup runs autobuild from the repo root, which cannot locate the Go module (go.mod lives in backend/), causing 'package could not be found: github.com/openscanner/openscanner/docs' warnings. This workflow mirrors ci.yml: installs swag, regenerates backend/docs/docs.go, then runs 'go build ./...' from backend/ under CodeQL's manual build mode. Also analyzes JS/TS with build-mode: none.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CodeQL default setup was flagging:
Root cause: the default setup runs
go build/ autobuild from the repo root, but OpenScanner'sgo.modlives inbackend/. Thedocspackage is also generated byswag initand is imported blankly in backend/internal/api/routes.go.Fix
Adds an advanced CodeQL workflow that mirrors the pattern already used in .github/workflows/ci.yml:
swagbackend/docs/docs.gofrombackend/go build ./...frombackend/under CodeQLbuild-mode: manualbuild-mode: noneRequired manual step after merge
GitHub does not allow default + advanced CodeQL setup simultaneously. Once this is merged to
dev(and latermain), disable default setup:Settings → Code security → Code scanning → CodeQL → Switch to advanced setup (or disable default).
Changelog
Pure CI/tooling change —
skip-changeloglabel applied per contributing guide.