Skip to content

feat: add reusable GitHub Action with sticky PR summary comment - #163

Merged
avidianity merged 1 commit into
mainfrom
feat/github-action
Nov 22, 2026
Merged

avidianity merged 1 commit into
mainfrom
feat/github-action

Conversation

@avidianity

Copy link
Copy Markdown
Owner

Summary

Add a reusable one-line GitHub Action (action.yml) at the repository root that installs codeint, runs codeint diff against the pull-request base, posts or updates one sticky pull-request summary comment (scripts/action-comment.mjs), and optionally uploads SARIF to GitHub code scanning.

Closes #160

Tier

Tier 2 from the tier check: action.yml, scripts/action-comment.mjs, and scripts/action-comment.test.mjs match no higher tier rule.

Task

Spec #160:

  • Add root composite action.yml with base-ref, path, version, comment, upload-sarif, fail-on-regression, and token inputs.
  • Add scripts/action-comment.mjs to create or update one sticky pull-request comment identified by a hidden HTML marker, truncating oversized reports cleanly.
  • Add unit tests in scripts/action-comment.test.mjs.
  • Document the one-line Action setup and inputs in docs/guide/ci-and-github-actions.md.

Fail-first test

  • Test: scripts/action-comment.test.mjs (buildCommentBody and findStickyCommentId)
  • Before the change: file did not exist (ERR_MODULE_NOT_FOUND).
  • After the change: passed (3 passed; 0 failed via node --test scripts/action-comment.test.mjs).

Checks

Check Result
node --test scripts/action-comment.test.mjs passed (3/3)
cargo run --package xtask -- merged-result passed
npx markdownlint-cli2 docs/guide/ci-and-github-actions.md passed (0 issues)
cargo run --package codeint-cli -- diff origin/main passed (0 new findings)
Pre-commit and commit-msg hooks passed

Safety proof

  • Safety fact: action.yml passes all user inputs and GitHub context values through env: variables (never interpolating them into shell commands), pins github/codeql-action/upload-sarif by full commit SHA, and defaults upload-sarif to false.
  • Proof: node --test scripts/action-comment.test.mjs (3/3 passed), xtask merged-result passed, and codeint diff origin/main reported 0 new findings.
  • interrogate: none required below Tier 3; CodeQL Analyze (actions) and Analyze (javascript-typescript) run in CI.

Runtime evidence

  • Build revision: 0dc9dc0
  • Verified scripts/action-comment.mjs sticky-comment formatting, truncation, and marker detection via node --test scripts/action-comment.test.mjs.

Gaps

  • Deferred coverage: live GitHub pull-request API POST/PATCH call is verified by CodeQL + unit tests on the pure request payload/marker helpers.
  • Pre-existing failures: none
  • Environmental failures: none

@github-actions github-actions Bot added the tier-2 Tier 2 from the tier check label Nov 22, 2026
@avidianity
avidianity merged commit d487f90 into main Nov 22, 2026
13 of 14 checks passed
@avidianity
avidianity deleted the feat/github-action branch November 22, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tier-2 Tier 2 from the tier check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spec: One-line GitHub Action with sticky pull-request comment

1 participant