Skip to content

Run tests on CI#14

Merged
ivpusic merged 1 commit into
mainfrom
run_tests
Mar 4, 2026
Merged

Run tests on CI#14
ivpusic merged 1 commit into
mainfrom
run_tests

Conversation

@ivpusic
Copy link
Copy Markdown
Member

@ivpusic ivpusic commented Mar 4, 2026

Use github actions workflow

@cursor
Copy link
Copy Markdown

cursor Bot commented Mar 4, 2026

PR Summary

Cursor Bugbot is generating a summary for commit dad837f. Configure here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 4, 2026

📝 Walkthrough

Walkthrough

Adds a GitHub Actions CI workflow file that automatically runs Go tests on push and pull requests. The workflow checks out the repository, configures Go using the version specified in go.mod, and executes the test suite via go test ./....

Changes

Cohort / File(s) Summary
CI/CD Configuration
.github/workflows/ci.yml
Adds GitHub Actions workflow to automatically run Go tests on push and pull requests, with steps to checkout code, set up Go from go.mod, and execute test suite.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding CI tests via GitHub Actions workflow.
Description check ✅ Passed The description is directly related to the changeset, mentioning GitHub Actions workflow which matches the CI workflow addition.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 7-15: Replace mutable action tags actions/checkout@v4 and
actions/setup-go@v5 with their pinned commit SHAs and add an explicit top-level
permissions: block to limit GITHUB_TOKEN scopes; locate the workflow job
definition around the job named "test" and update the uses entries
(actions/checkout and actions/setup-go) to their corresponding commit SHA
commits, then add a top-level permissions: mapping (e.g., read-only for contents
and minimal scopes required for the job) to the workflow root so the workflow no
longer relies on default full repository permissions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5acb9a3b-6693-44d8-a970-e606dbb468fa

📥 Commits

Reviewing files that changed from the base of the PR and between c819687 and dad837f.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Comment thread .github/workflows/ci.yml
Comment on lines +7 to +15
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/ci.yml

Repository: duneanalytics/cli

Length of output: 415


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Mutable action refs (not pinned to 40-char SHA) =="
rg -nP --type=yaml '^\s*-\s*uses:\s*[^@]+@(?!(?:[0-9a-f]{40})\b)' .github/workflows || true

echo
echo "== Workflows missing explicit top-level permissions =="
fd -t f '.+\.ya?ml' .github/workflows | while read -r f; do
  if ! rg -n '^\s*permissions:' "$f" >/dev/null; then
    echo "$f"
  fi
done

Repository: duneanalytics/cli

Length of output: 319


Pin action versions to commit SHAs and add explicit workflow permissions.

Lines 11 and 13 use mutable version tags (@v4, @v5) instead of pinned commit SHAs. The workflow also lacks an explicit top-level permissions: block, allowing the default GITHUB_TOKEN to retain full repository access. This creates supply-chain and privilege-escalation risks.

🔐 Recommended hardening
 name: CI

 on:
   push:
   pull_request:

+permissions:
+  contents: read
+
 jobs:
   test:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@<full-length-commit-sha> # pin v4

-      - uses: actions/setup-go@v5
+      - uses: actions/setup-go@<full-length-commit-sha> # pin v5
         with:
           go-version-file: go.mod

       - run: go test ./...
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 7 - 15, Replace mutable action tags
actions/checkout@v4 and actions/setup-go@v5 with their pinned commit SHAs and
add an explicit top-level permissions: block to limit GITHUB_TOKEN scopes;
locate the workflow job definition around the job named "test" and update the
uses entries (actions/checkout and actions/setup-go) to their corresponding
commit SHA commits, then add a top-level permissions: mapping (e.g., read-only
for contents and minimal scopes required for the job) to the workflow root so
the workflow no longer relies on default full repository permissions.

@ivpusic ivpusic merged commit 44dabca into main Mar 4, 2026
4 checks passed
@ivpusic ivpusic deleted the run_tests branch March 6, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant