Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 6, 2026

Plan: Update ci-build.yml to Support Required Branch Checks

  • Remove paths-ignore filters from PR and push triggers
  • Add a step to detect if only documentation files were changed
  • Conditionally skip build steps when only docs changed
  • Ensure the workflow always runs and completes successfully
  • Validate the YAML syntax
  • Address code review feedback (edge cases, robustness)
  • Final code review
  • Run security checks (CodeQL - 0 alerts)
  • Fix git safe directory configuration order (build failure)
  • Refactor into multi-job architecture for resource efficiency

Implementation Complete ✅

The workflow now uses a 3-job architecture for optimal resource usage:

Job Architecture

  1. check-changes (ubuntu-22.04): Lightweight job that detects documentation-only changes and determines build template
  2. build (custom 1ES agent): Only runs when code changes detected (job-level if condition); performs full Yocto build
  3. status-check (ubuntu-22.04): Gate job that always runs and determines overall success

Key Features

  • Always runs on PRs and pushes to main/kirkstone
  • Detects documentation-only changes dynamically
  • Avoids spinning up expensive build agent for docs-only changes
  • Build job completely skipped (not just steps) when only docs changed
  • Gate job ensures workflow always completes with proper status
  • Handles edge cases (first commit, empty files, etc.)
  • Clean code without step-level conditionals

Benefits

Resource efficient: Saves expensive build agent resources for docs-only PRs
Cleaner code: No step-level conditionals cluttering the workflow
Required check compatible: Can be safely added to branch protection rules
Always completes: Gate job ensures status is always reported

Original prompt

I want to update the ci-build.yml pipeline so that it:

  1. Still doesn't execute a build when the only changes are markdown files
  2. But it can be added as a required check in the branch policies for main.
    Today, ci-build.yml doesn't run when the PR only touches markdown files (due to the ignore-paths property in the PR trigger), so if I were to make it a required check on all PRs, some PRs would be stuck waiting for the check to pass. Can you make a PR that works around this problem in a simple, sensible way?

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Update ci-build.yml for required check in branch policies Enable ci-build.yml as required check with conditional execution for doc changes Feb 6, 2026
Copilot AI requested a review from damonbarry February 6, 2026 18:48
Copilot AI changed the title Enable ci-build.yml as required check with conditional execution for doc changes Enable ci-build.yml as required check with multi-job architecture for doc changes Feb 6, 2026
Copilot AI requested a review from damonbarry February 6, 2026 19:59
@jlian jlian marked this pull request as ready for review February 6, 2026 21:15
@jlian jlian enabled auto-merge (squash) February 6, 2026 21:16
Copilot AI and others added 4 commits February 6, 2026 13:16
- Remove paths-ignore filters from PR and push triggers
- Add step to detect documentation-only changes
- Conditionally skip build steps when only docs changed
- Workflow always runs and completes, enabling required check usage

Co-authored-by: damonbarry <9042469+damonbarry@users.noreply.github.com>
- Use == for string comparison consistency
- Handle first commit edge case with fallback
- Check for empty CHANGED_FILES to avoid false positives
- Skip empty lines in the file check loop

Co-authored-by: damonbarry <9042469+damonbarry@users.noreply.github.com>
Move git safe directory configuration before docs-only check to fix build failure. The git commands in the docs check step need the workspace to be marked as safe first.

Co-authored-by: jlian <2320572+jlian@users.noreply.github.com>
- Move docs-only check to separate lightweight job on ubuntu-22.04
- Add job-level if condition to build job (avoids spinning up expensive agent)
- Add status-check gate job that always runs and determines overall success
- Remove individual step-level if conditions (cleaner)
- Build job only runs when code changes detected

Co-authored-by: damonbarry <9042469+damonbarry@users.noreply.github.com>
@jlian jlian force-pushed the copilot/update-ci-build-pipeline-requirements branch from 7b07b52 to c23d863 Compare February 6, 2026 21:16
@jlian jlian merged commit bac0bb2 into main Feb 6, 2026
2 checks passed
@jlian jlian deleted the copilot/update-ci-build-pipeline-requirements branch February 6, 2026 21:16
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.

3 participants