Skip to content

[ci-coach] ci: add path filters to build-deploy workflow #49

@github-actions

Description

@github-actions

Summary

Add paths filters to build-deploy.yml so the React build only runs when src/ui/ files or the workflow itself change. This eliminates unnecessary build runs triggered by unrelated commits (agentic workflow additions, docs, etc.).


Optimizations

1. Path Filtering on build-deploy.yml

Type: Conditional Execution
Impact: ~18 seconds + runner minutes saved per skipped run
Risk: Low

Changes:

  • Added paths: ['src/ui/**', '.github/workflows/build-deploy.yml'] to both the push and pull_request triggers

Rationale: The repository sees a high volume of commits that only touch .github/workflows/*.lock.yml files or documentation — none of which affect the React app in src/ui/. Before this change, every one of those commits triggered a full build job. With path filtering, GitHub Actions skips the workflow entirely when no matching files change.

Detailed Analysis

Evidence from recent runs:

Before: Build triggers on every push/PR to main, regardless of what changed
After: Build only triggers when src/ui/** or build-deploy.yml itself changes

What is preserved: The workflow still runs correctly for all genuine UI changes, and including build-deploy.yml in the paths ensures any CI changes to the workflow itself are validated.


Expected Impact

  • Time Savings: ~18 seconds per skipped run × N non-UI PRs/day
  • Cost Reduction: Proportional reduction in ubuntu-latest runner minutes
  • Risk Level: Low — no logic changes, only trigger scoping

Testing Recommendations

  • Workflow YAML syntax is valid
  • Confirm no branch protection rule requires the build check on every PR
  • Monitor first few runs after merge to verify path filter behaves as expected

Generated by CI Optimization Coach ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/ci-coach.md@ee86d0ffcb1705d4ee4146e92125227bf9136aae
  • expires on Mar 23, 2026, 5:06 PM UTC

Warning

🛡️ Protected Files — Push Permission Denied

This was originally intended as a pull request, but the patch modifies protected files: .github/workflows/build-deploy.yml.

The push was rejected because GitHub Actions does not have workflows permission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission. A human must create the pull request manually.

To create a pull request with the changes:

# Download the patch from the workflow run
gh run download 23384409225 -n agent-artifacts -D /tmp/agent-artifacts-23384409225

# Create a new branch
git checkout -b ci-coach/add-path-filters-build-deploy-cf858fdfa6fb43bb main

# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-artifacts-23384409225/aw-ci-coach-add-path-filters-build-deploy.patch

# Push the branch and create the pull request
git push origin ci-coach/add-path-filters-build-deploy-cf858fdfa6fb43bb
gh pr create --title '[ci-coach] ci: add path filters to build-deploy workflow' --base main --head ci-coach/add-path-filters-build-deploy-cf858fdfa6fb43bb --repo lloydmckie-lang/github-agentic-workflows

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions