Skip to content

Exclude documentation and .github from CI triggers#13214

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/update-ci-trigger-paths
Draft

Exclude documentation and .github from CI triggers#13214
Copilot wants to merge 3 commits intomainfrom
copilot/update-ci-trigger-paths

Conversation

Copy link
Contributor

Copilot AI commented Feb 6, 2026

Context

CI pipelines trigger full test runs for changes to documentation and Copilot instruction files (.github/), wasting resources on non-build file changes.

Changes Made

.vsts-dotnet-ci.yml

  • Added paths.exclude filters to both trigger and pr sections for documentation/* and .github/*
  • Converts simple branch list to structured format required for path filtering:
trigger:
  branches:
    include:
    - main
    - exp/*
    - vs*
  paths:
    exclude:
    - documentation/*
    - .github/*

azure-pipelines/check-documentation-only-change.yml

  • Expanded PowerShell pattern matching to recognize .github/* files as non-build files:
$isNonBuildFile = ($file -match "^documentation/") -or ($file -match "^\.github/")
  • Preserves onlyDocChanged variable name for backward compatibility with 84+ downstream references

Testing

Validated PowerShell logic handles all scenarios: documentation-only, .github-only, mixed non-build files, and code file inclusions.

Notes

Pipeline will no longer trigger for documentation/Copilot changes. Safety net still protects mixed-commit scenarios.

Original prompt

Problem

Azure DevOps test jobs trigger and run for a long time even when only non-build files like Copilot instructions (.github/) or documentation (documentation/) are changed. This wastes CI resources.

Solution

Make two changes:

1. Add paths.exclude to the CI and PR triggers in .vsts-dotnet-ci.yml

The file currently has a simple trigger with no path filters:

trigger:
- main
- exp/*
- vs*

Change this to use paths.exclude so the pipeline doesn't even start for non-build file changes:

trigger:
  branches:
    include:
    - main
    - exp/*
    - vs*
  paths:
    exclude:
    - documentation/*
    - .github/*

pr:
  paths:
    exclude:
    - documentation/*
    - .github/*

This is a GitHub-hosted repo, so both trigger: and pr: support YAML paths filters.

2. Expand azure-pipelines/check-documentation-only-change.yml to also recognize .github/ files

The current check only recognizes files under documentation/:

$isUnderDocumentation = $file -match "^documentation/"

Update this to also treat .github/ files as non-build changes, so that even in mixed-commit scenarios, the safety net correctly identifies non-build-only changes. Change the variable name and match to something like:

$isNonBuildFile = ($file -match "^documentation/") -or ($file -match "^\.github/")
if(!$isNonBuildFile)

Make sure the output variable name (onlyDocChanged) stays the same so all downstream references continue to work.

Context

  • PR Expand test instructions into their own file #13212 adds Copilot test instruction files under .github/ — this is the kind of change that should not trigger full test runs.
  • The repo's CI pipeline is at .vsts-dotnet-ci.yml.
  • The documentation-only check template is at azure-pipelines/check-documentation-only-change.yml.
  • Many jobs reference the onlyDocChanged variable — do NOT rename it.

This pull request was created from Copilot chat.


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

@dotnet-policy-service
Copy link
Contributor

Hello @@copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo.

Copilot AI and others added 2 commits February 6, 2026 17:36
…-build file detection

Co-authored-by: rainersigwald <3347530+rainersigwald@users.noreply.github.com>
Co-authored-by: rainersigwald <3347530+rainersigwald@users.noreply.github.com>
Copilot AI changed the title [WIP] Update CI triggers to exclude non-build file changes Exclude documentation and .github from CI triggers Feb 6, 2026
Copilot AI requested a review from rainersigwald February 6, 2026 17:39
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

Comments