🔧 build(ci): ensure CI runs on prepare-release PRs#641
Conversation
Fixes #640 Modifies CI workflow to always run on release branches (release/v*) created by the prepare-release workflow, even when only docs/changelog files are modified. ## Changes - Removed workflow-level `paths-ignore` filters (lines 8-12, 16-22) - Added new `changes` job that determines whether to run CI based on: * Branch name pattern (always run for release/* branches) * Changed files (skip for docs-only on regular PRs) - Made all CI jobs conditional on `changes` job output - Updated `all-jobs` aggregator to include `changes` dependency ## Implementation Details The `changes` job checks: 1. If branch matches `release/*` pattern → always run CI 2. If branch is regular PR → check changed files - Skip if only: *.md, docs/**, *.txt, .gitignore - Run if any code files changed 3. If push to main → always run CI This ensures the Release workflow's verify-ci job can find required checks (Check, Test, Clippy, Build) even for release PRs that only modify CHANGELOG.md and Cargo.toml. ## References - Issue: #640 - Failed release run: https://github.com/codekiln/langstar/actions/runs/19992537324 - prepare-release workflow: .github/workflows/prepare-release.yml:241 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Unit Test Results174 tests 174 ✅ 1s ⏱️ Results for commit 82248c4. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
This PR modifies the CI workflow to ensure that all CI jobs run on release branches (matching release/* pattern) even when only documentation or changelog files are modified. This fixes issue #640 where the Release workflow's verify-ci job was failing because CI checks were being skipped due to paths-ignore filters.
Key Changes:
- Removed workflow-level
paths-ignorefilters and replaced them with a newchangesjob that performs job-level conditional execution - Added branch pattern detection to always run CI for
release/*branches - Updated all CI jobs to depend on the
changesjob with conditional execution based on file changes
Comments suppressed due to low confidence (1)
.github/workflows/ci.yml:366
- Missing the
check-feature-publish-statusjob from theall-jobsneeds list. Theall-jobsaggregator should include all jobs that can run in the workflow to properly reflect the overall CI status.
Add check-feature-publish-status to the needs list at line 367:
needs:
- changes
- check
- test
- integration-tests
- clippy
- audit
- build
- check-feature-publish-statusNote: Jobs with conditional execution (like if: github.event_name == 'pull_request') can still be included in the needs list; they'll show as "skipped" when conditions aren't met, which the jq check at line 370 already handles correctly.
needs:
- changes
- check
- test
- integration-tests
- clippy
- audit
- build
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Integration Test Results275 tests 275 ✅ 3m 3s ⏱️ Results for commit 82248c4. ♻️ This comment has been updated with latest results. |
Addresses review comments from PR #641: - Add error handling for gh pr view failures (safer default) - Add check for empty CHANGED_FILES - Fix .txt file pattern matching logic (use regex instead of glob) - Use == instead of = for consistency with double-bracket tests Changes: 1. Line 60: Added 2>/dev/null error suppression and fallback 2. Lines 61-65: Added empty check with safe default (run CI) 3. Line 73: Fixed .txt pattern to use regex `! "$file" =~ /` 4. Line 82: Changed `=` to `==` for consistency All changes improve robustness and follow bash best practices. Addresses: - #641 (comment) - #641 (comment) - #641 (comment) - #641 (comment)
Summary
Fixes #640
Modifies the CI workflow to always run on release branches (
release/v*) created by the prepare-release workflow, even when only documentation or changelog files are modified.This resolves the issue where the Release workflow's
verify-cijob fails because it expects CI checks (Check, Test, Clippy, Build) to have run, but they were skipped due topaths-ignorefilters.Changes
Workflow-Level Changes
paths-ignorefilters from workflow-level triggers (previously at lines 8-12, 16-22)New
changesJobAdded a new job that determines whether to run CI based on:
release/*branches (created by prepare-release workflow)**/*.md(markdown files)docs/**(documentation directory)*.txt(root-level text files).gitignoreJob Dependencies
changesjobif: needs.changes.outputs.should_run == 'true'all-jobsaggregator to includechangesin its needs listImplementation Details
The
changesjob (lines 29-90):release/*gh pr viewto get changed files and filters themshould_runtotrue/falsebased on the checks aboveAll downstream jobs check
needs.changes.outputs.should_run == 'true'before running.Why This Approach?
Alternative approaches considered:
pull_request_target: Security implications (runs in base branch context)pull_requestentriespaths-ignore✅ Job-level conditionals: Allows workflow to run, then conditionally execute jobs based on branch and file changes.
Testing
This PR will test the new logic:
.github/workflows/ci.ymlReferences
.github/workflows/prepare-release.yml:241(branch pattern).github/workflows/release.yml:19-58Test Plan
gh workflow view)🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com