[release/v7.6] Add reusable get-changed-files action and refactor existing actions#26529
Merged
TravisEz13 merged 1 commit intoPowerShell:release/v7.6from Nov 25, 2025
Conversation
…owerShell#26355) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR backports a refactoring of GitHub Actions infrastructure by introducing a new reusable get-changed-files action. The refactoring consolidates duplicate file-fetching logic from multiple actions into a single, well-tested component that properly handles pagination and security.
Key Changes
- New reusable action: Created
get-changed-filesaction with pagination support, optional filtering, and support for both pull_request and push events - Security improvements: Refactored both
path-filtersandmarkdownlinksactions to use environment variables instead of direct output interpolation, preventing script injection attacks - Enhanced packaging detection: Added Linux-specific files (linux-ci.yml and test/packaging/linux/) to the packaging change detection logic in path-filters
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
.github/actions/infrastructure/get-changed-files/action.yml |
New composite action that fetches changed files with pagination, filtering support, and hash-based verification |
.github/actions/infrastructure/get-changed-files/README.md |
Comprehensive documentation for the new action including usage examples, input/output specifications, and pagination details |
.github/actions/infrastructure/path-filters/action.yml |
Refactored to use get-changed-files action, improved security by using environment variables, added detailed logging with collapsible groups, and enhanced packaging detection for Linux |
.github/actions/infrastructure/markdownlinks/action.yml |
Simplified by delegating file fetching to get-changed-files action and improved security using environment variables |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7 tasks
Copilot AI
added a commit
that referenced
this pull request
Nov 25, 2025
- Fix README.md: Change "Handles up to 100 changed files" to "Handles all changed files (no limit)" - Fix README.md: Add actions/checkout step to basic usage example - Fix README.md: Improve limitations section with better filter pattern description - Fix action.yml: Change filter logic to use case-sensitive comparison for consistency with git Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
SeeminglyScience
approved these changes
Nov 25, 2025
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #26355 to release/v7.6
Triggered by @TravisEz13 on behalf of @TravisEz13
Original CL Label: CL-Tools
/cc @PowerShell/powershell-maintainers
Impact
REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.
Tooling Impact
Adds a new reusable get-changed-files action that both markdownlinks and path-filters actions now use. This refactoring improves code reusability and maintainability of GitHub Actions infrastructure.
Customer Impact
Regression
REQUIRED: Check exactly one box.
This is not a regression.
Testing
The new get-changed-files action handles pagination correctly to fetch all changed files. The refactored actions (markdownlinks and path-filters) maintain identical behavior to the previous versions. Verified that all action outputs remain the same after refactoring.
Risk
REQUIRED: Check exactly one box.
This refactors critical GitHub Actions used in CI/CD pipeline. While the logic is identical to the previous implementation, the new reusable action pattern introduces a new layer of abstraction that should be monitored. The refactoring removes the old inline logic and replaces it with calls to the new action, reducing code duplication.
Merge Conflicts
One file had merge conflicts during cherry-pick:
.github/actions/infrastructure/path-filters/action.yml. The conflict was in the packagingChanged detection logic where the release branch was using old code that checkedfile.filenameinstead offile. The refactored version uses the newfilestring format (direct file paths) that the new get-changed-files action provides. The conflict was resolved by applying the refactored logic from the original PR.