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
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI — Lint, Test, Smoke

on:
pull_request:
branches: [master]
push:
branches: [master]

jobs:
quality:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/ci.yml
printf '%s\n' '--- workflow files ---'
git ls-files '.github/workflows/*'
printf '%s\n' '--- checkout and permission settings ---'
rg -n -C 3 'actions/checkout|permissions:|pull_request|npm ci|npm run|setup-node' .github/workflows
printf '%s\n' '--- package scripts and lifecycle hooks ---'
python3 - <<'PY'
import json
from pathlib import Path

p = Path("package.json")
if p.exists():
    data = json.loads(p.read_text())
    scripts = data.get("scripts", {})
    for name, value in scripts.items():
        print(f"{name}: {value}")
    for name in ("preinstall", "install", "postinstall", "prepare"):
        if name in scripts:
            print(f"lifecycle {name}: {scripts[name]}")
else:
    print("package.json: absent")
PY

Repository: Flamki/stellarmind

Length of output: 9504


🏁 Script executed:

#!/bin/bash
set -e
python3 - <<'PY'
from pathlib import Path

text = Path(".github/workflows/ci.yml").read_text()
checkout = next((line for line in text.splitlines() if "actions/checkout@" in line), None)
print("checkout:", checkout)
print("persist-credentials explicitly set:", "persist-credentials:" in text)
print("top-level permissions block:", any(line.startswith("permissions:") for line in text.splitlines()))
print("job-level permissions blocks:", any(line.startswith("    permissions:") for line in text.splitlines()))
print("pull_request trigger:", "pull_request:" in text or "pull_request" in text)
print("npm ci present:", "npm ci" in text)
print("npm run present:", "npm run" in text)
PY

Repository: Flamki/stellarmind

Length of output: 383


🏁 Script executed:

cat -n .github/workflows/ci.yml

Repository: Flamki/stellarmind

Length of output: 1226


Disable persisted GitHub credentials before running pull request code.

The pull_request job runs npm ci and multiple npm run commands, which execute repository-controlled code. Set persist-credentials: false and restrict the job to contents: read.

🧰 Tools
🪛 zizmor (1.29.0)

[warning] 15-15: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 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/ci.yml at line 15, Update the pull_request job in the
workflow to configure actions/checkout with persist-credentials disabled and add
job-level contents: read permissions, ensuring repository-controlled npm
commands cannot access persisted GitHub credentials.

Source: Linters/SAST tools


- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Lint (ESLint)
run: npm run lint

- name: Lint (Markdown)
run: npm run lint:md

- name: Format check (Prettier)
run: npm run format:check

- name: Run tests
run: npm test

- name: Smoke test
run: npm run smoke

- name: API validation tests
run: npm run test:validation
Loading