Skip to content

ci: run CI on pull requests targeting any base branch - #104

Closed
kakadlec wants to merge 1 commit into
mainfrom
ci/run-on-all-pull-requests
Closed

ci: run CI on pull requests targeting any base branch#104
kakadlec wants to merge 1 commit into
mainfrom
ci/run-on-all-pull-requests

Conversation

@kakadlec

Copy link
Copy Markdown
Owner

Problem

.github/workflows/ci.yml declared:

on:
  pull_request:
    branches: [main]

on.pull_request.branches filters on the pull request's base branch. Pinning it to main meant a stacked PR — one whose base is another feature branch — triggered none of the three jobs. Build & Test, SAST (gosec) and Vulnerability Scan (govulncheck) simply never appeared on those PRs, so the whole stack ran without any CI signal until each PR was retargeted to main (which GitHub does automatically once the base branch is deleted post-merge, i.e. only at the very end).

Branch protection still guarded main itself, so nothing unverified reached main — but the feedback arrived at the worst possible moment, after the stack was already built on top of unverified commits.

Fix

Drop the branches: filter so every pull request runs CI regardless of base. The push trigger keeps its branches: [main] filter, which is correct there — that one avoids duplicate runs on feature-branch pushes that already have a PR.

Conformance

This also restores agreement with the canonical openspec/specs/development-workflow/spec.md, whose three gate requirements all read "Every push to main and every pull request SHALL …" — unqualified by base branch. The workflow was under-implementing an already-approved requirement, so no spec delta is needed.

Verification

  • YAML parses to {'push': {'branches': ['main']}, 'pull_request': None}None being the "all base branches" form.
  • git diff --check clean.
  • No Go module input (.go/go.mod/go.sum) in the diff, so the local go test ./... -v gate does not apply and was not run. The three CI jobs run on this PR itself, which exercises the changed trigger directly.

🤖 Generated with Claude Code

`on.pull_request.branches` filters on the pull request's base branch, so
`branches: [main]` meant a stacked PR — one whose base is another feature
branch rather than main — triggered none of the three required jobs. The
checks never appeared on those PRs, leaving the stack without any CI signal
until each PR was retargeted to main.

This also brings the workflow back in line with the canonical
`development-workflow` spec, whose Automated Test Gate, SAST Gate, and
Vulnerability Scan Gate requirements all read "every push to `main` and every
pull request" — unqualified by base branch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings August 10, 2026 01:43
@kakadlec kakadlec closed this Aug 10, 2026
@kakadlec
kakadlec deleted the ci/run-on-all-pull-requests branch August 10, 2026 01:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates CI triggers so all pull requests run required quality gates, including stacked PRs.

Changes:

  • Removes the main base-branch filter from pull_request.
  • Documents why the trigger is intentionally unfiltered.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants