Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

name: Go Linter

on:
workflow_dispatch:

jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ['1.23','1.22']
steps:
Comment on lines +7 to +13

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Broken job structure — workflow won't parse.

runs-on, strategy, and steps need to be nested under a single job id (e.g. lint:), not treated as separate jobs. As flagged by actionlint, each is currently missing its own runs-on/steps, and fail-fast/matrix are invalid keys directly under jobs.

🛠️ Proposed fix
 jobs:
-  runs-on: ubuntu-latest
-  strategy:
-    fail-fast: false
-    matrix:
-      go: ['1.23','1.22']
-  steps:
+  lint:
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        go: ['1.23','1.22']
+    steps:

Remaining step lines under steps: will also need to be re-indented one level deeper to nest correctly under the job.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ['1.23','1.22']
steps:
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ['1.23','1.22']
steps:
🧰 Tools
🪛 actionlint (1.7.12)

[error] 8-8: "runs-on" section is missing in job "runs-on"

(syntax-check)


[error] 8-8: "steps" section is missing in job "runs-on"

(syntax-check)


[error] 8-8: "runs-on" job is scalar node but mapping node is expected

(syntax-check)


[error] 9-9: "runs-on" section is missing in job "strategy"

(syntax-check)


[error] 9-9: "steps" section is missing in job "strategy"

(syntax-check)


[error] 10-10: unexpected key "fail-fast" for "job" section. expected one of "concurrency", "container", "continue-on-error", "defaults", "env", "environment", "if", "name", "needs", "outputs", "permissions", "runs-on", "secrets", "services", "snapshot", "steps", "strategy", "timeout-minutes", "uses", "with"

(syntax-check)


[error] 11-11: unexpected key "matrix" for "job" section. expected one of "concurrency", "container", "continue-on-error", "defaults", "env", "environment", "if", "name", "needs", "outputs", "permissions", "runs-on", "secrets", "services", "snapshot", "steps", "strategy", "timeout-minutes", "uses", "with"

(syntax-check)


[error] 13-13: "runs-on" section is missing in job "steps"

(syntax-check)


[error] 13-13: "steps" section is missing in job "steps"

(syntax-check)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/matrix.yml around lines 7 - 13, The workflow structure is
invalid because `runs-on`, `strategy`, and `steps` are currently placed directly
under `jobs` instead of under a single job id. Update the top-level job
definition in the workflow so these keys are nested beneath a named job (for
example, the job that contains the matrix for `go`), and re-indent all existing
step entries under `steps` one level deeper. Use the workflow’s job block and
the `strategy`/`steps` section as the fix location.

Source: Linters/SAST tools

- name: Setup Go
uses: actions/checkout@v6
with:
go-version: ${{ matrix.go }}
go-version-file: 'go.mod'
cache-dependency-path: go.sum
Comment on lines +14 to +19

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Wrong action used for Go setup.

Step is named "Setup Go" and passes go-version, go-version-file, and cache-dependency-path, but uses actions/checkout@v6 instead of actions/setup-go@v6. Go won't be installed/configured, and the subsequent go fmt/go vet steps will fail. The existing ci.yml workflow uses actions/setup-go@v6 with the same inputs for this exact purpose.

🛠️ Proposed fix
     - name: Setup Go
-      uses: actions/checkout@v6
+      uses: actions/setup-go@v6
       with:
         go-version: ${{ matrix.go }}   
         go-version-file: 'go.mod'
         cache-dependency-path: go.sum

Note this step also needs a preceding actions/checkout step, since setup-go alone won't check out the repo source for go fmt/go vet to operate on.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Setup Go
uses: actions/checkout@v6
with:
go-version: ${{ matrix.go }}
go-version-file: 'go.mod'
cache-dependency-path: go.sum
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
go-version-file: 'go.mod'
cache-dependency-path: go.sum
🧰 Tools
🪛 actionlint (1.7.12)

[error] 14-14: "steps" job is sequence node but mapping node is expected

(syntax-check)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/matrix.yml around lines 14 - 19, The “Setup Go” step is
using the wrong action, so replace the current actions/checkout reference in the
matrix workflow with actions/setup-go@v6 and keep the Go-specific inputs on that
step. Also ensure the job still has a separate preceding actions/checkout step
before Setup Go so the repository source is available for the later go fmt and
go vet steps.


- name: Run go Formatter
run: go fmt
working-directory: backend

- name: Run go vet
run: go vet
working-directory: backend