Skip to content

feat(#370): GitHub Actions integration for CI/CD-driven workflows - #386

Merged
admarble merged 5 commits into
mainfrom
feature/370-github-actions-integration-for-ci-cd-driven-workfl
Mar 23, 2026
Merged

admarble merged 5 commits into
mainfrom
feature/370-github-actions-integration-for-ci-cd-driven-workfl

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Add composite GitHub Action (sequant-action/action.yml) that runs sequant workflows as CI steps
  • New src/lib/ci/ module with trigger detection, input validation, config loading, label lifecycle management, and structured output formatting
  • Three example workflows: label trigger (sequant:solve), manual dispatch, and issue comment trigger (@sequant run)
  • 69 new unit tests across 5 test files covering all CI modules

AC Coverage

Phase 1: Basic Action

AC Description Status Evidence
AC-1 Action published to marketplace ✅ sequant-action/action.yml with all required fields
AC-2 workflow_dispatch with inputs ✅ action.yml inputs: issues, phases, agent, timeout, quality-loop, api-key
AC-3 issues event trigger ✅ triggers.ts + solve-on-label.yml example
AC-4 Creates worktree, runs phases, posts results ✅ action.yml step 6 runs npx sequant@latest run with full flags
AC-5 Creates PR on successful QA ✅ sequant CLI handles PR creation; action captures PR URL
AC-6 Structured output ✅ outputs.ts + action.yml outputs: issue, success, phases, pr-url, duration
AC-7 Logs uploaded as artifacts ✅ action.yml step 8 uses actions/upload-artifact@v4

Phase 2: Event-Driven Automation

AC Description Status Evidence
AC-8 Label trigger (sequant:solve) ✅ triggers.ts:detectTrigger() + solve-on-label.yml
AC-9 Phase override labels ✅ TRIGGER_LABELS in types.ts: spec-only, exec, qa
AC-10 Automatic label cleanup ✅ labels.ts lifecycle + action.yml steps 5/7
AC-11 Comment trigger (@sequant run) ✅ triggers.ts:detectCommentTrigger() + comment-trigger.yml
AC-12 Concurrency control ✅ Example workflows use concurrency: { group: sequant-issue-${{ ... }} }

Phase 3: Configuration

AC Description Status Evidence
AC-13 Repo-level config file ✅ config.ts loads .github/sequant.yml or .sequant/ci.json
AC-14 Agent selection per-repo ✅ Config agent field + action input + merge precedence
AC-15 Secret management ✅ action.yml: api-key input + ::add-mask:: step
AC-16 Cost controls ✅ timeout-minutes + maxConcurrentRuns in config + concurrency groups

Derived ACs

AC Description Status Evidence
AC-17 Post error details on failure ✅ action.yml step 6 posts summary on any exit code
AC-18 Fail fast on auth failure ✅ action.yml step 3 checks gh auth status
AC-19 --no-mcp in CI ✅ action.yml step 6 always includes --no-mcp
AC-20 API keys masked in logs ✅ action.yml step 4: ::add-mask::

Test plan

  • npm run build — passes (0 errors)
  • npm run lint — passes (0 warnings)
  • npm test — 1651 tests pass (67 test files), including 69 new CI tests
  • Manual: validate action.yml against GitHub Actions schema
  • Manual: test with a real workflow_dispatch trigger

Closes #370

🤖 Generated with Claude Code

Add composite GitHub Action and CI TypeScript modules that enable
running sequant workflows from GitHub Actions, triggered by issue
labels, comments, or manual dispatch.

- sequant-action/action.yml: composite action with inputs/outputs
- src/lib/ci/: trigger detection, input validation, config loading,
  label lifecycle management, and output formatting
- Example workflows: label trigger, manual dispatch, comment trigger
- 69 new tests across 5 test files

Closes #370

Entire-Checkpoint: 6da78a605666
…ency tests

Move all ${{ inputs.* }} and ${{ github.event.* }} references from
inline run: blocks to env: bindings, preventing shell injection via
untrusted input (e.g., issue comment bodies). Add input validation
to strip non-numeric characters from issue numbers.

Add action-consistency.test.ts to catch divergence between the
TypeScript CI module constants and the action.yml shell scripts.
Replace fragile regex-based run block extraction with a proper
line-by-line YAML parser. Add sanity check that verifies run blocks
are actually found (prevents silent pass on broken extraction).

Add test for untrusted event data patterns (comment.body, issue.title,
issue.body, PR title/body) — not just inputs.
- Add sequant-version input (default: "^1") instead of @latest for
  reproducible CI builds
- Only export API key to the env var matching the selected agent
  (ANTHROPIC_API_KEY for claude-code, OPENAI_API_KEY for aider/codex)
  instead of leaking it to both
- Replace GNU-specific grep -oP with POSIX-compatible sed in
  comment-trigger.yml example (portable across runner platforms)
- Add consistency tests for version pinning and API key scoping
Operational documentation covering setup (3 trigger modes),
configuration (.github/sequant.yml), action reference (inputs,
outputs, label lifecycle), and troubleshooting.
@admarble
admarble force-pushed the feature/370-github-actions-integration-for-ci-cd-driven-workfl branch from a3b87ec to 7e3d0e7 Compare March 23, 2026 13:43
@admarble
admarble merged commit f990096 into main Mar 23, 2026
6 of 10 checks passed
@admarble
admarble deleted the feature/370-github-actions-integration-for-ci-cd-driven-workfl branch March 23, 2026 13:47
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.

GitHub Actions integration for CI/CD-driven workflows

1 participant