Repository navigation
Description
Problem: #106 adds a composite GitHub Action (action.yml), pre-commit hooks and docs/CI.md, but none of it has run in a real pipeline yet. A team that adds uses: secfoo-com/secfoo@main today gets a SARIF upload and a job summary, and that is all: no comment on the pull request, no memory between runs (every job starts with an empty ~/.secfoo, so open/closed lifecycle and "new since last run" never work in CI), and nothing in this repo would catch the action breaking.
Goal: the action is exercised on every PR to this repo, posts one sticky comment on the pull request it reviews, and can keep its findings store between runs.
Build:
- Self-test workflow.
.github/workflows/action-selftest.ymlrunsuses: ./on pull requests against a small fixture (e.g.examples/sample-output/nodegoatas the target is fine, or a two-file fixture undertests/fixtures/ci/). The public repo has no provider key, so add a deterministicfakeagent adapter (--agent fake, hidden fromsecfoo agentsunlessSECFOO_FAKE_AGENT=1) that returns a canned report from a file. Assert:exit-code,critical/high/medium/lowandcost-usdoutputs are set; the SARIF validates against the SARIF 2.1.0 JSON schema; exit codes 0, 1, 2 and 3 map correctly (four jobs, one per code); the step summary contains the results table. Fix whatever the self-test turns up inaction.yml. - Sticky PR comment. Input
comment: true(defaulttrueonpull_requestevents, needspull-requests: write): the action creates or updates one comment (marker<!-- secfoo -->) with the per-skill table, the gate verdicts, the agent-reported cost, and a link to the code-scanning alerts. Never fail the job because the comment could not be posted (forks have read-only tokens); log a notice instead. - Cached store. Input
cache: truerestores and saves~/.secfoowithactions/cachekeyed on the repository and branch, so the second run of a PR sees findings as open/closed rather than all-new, and--rescanstays off unless the commit was already scanned. Document the trade-off (the cache holds report text) and thecache-keyoverride. - Lint the YAML. Add
actionlintforaction.yml,.github/workflows/*.ymlandexamples/ci/github-actions*.ymlto CI. - Docs:
docs/CI.mdgains the new inputs and a screenshot of the PR comment.
Where to look: action.yml, .github/workflows/ci.yml, docs/CI.md, examples/ci/, src/secfoo/agents/registry.py and base.py (for the fake adapter), src/secfoo/report/sarif.py, tests/conftest.py (fake_popen shows how agents are faked in unit tests today).
Relation: builds on #106 (merge first). Pairs with the baseline work in the diff-aware-scan issue; the comment should show "N new, M in baseline" once that lands.
Done when: the self-test workflow is green on PRs; the four exit-code jobs each assert their code; the SARIF schema check runs in the self-test; a test PR in a scratch repo shows the sticky comment being created and then updated; actionlint runs in CI; docs updated.
Activity
niharika3715 commentedon Nov 27, 2026
closes issue #108
created a pr against this issue: #203