Skip to content

[release/v7.6] Add reusable get-changed-files action and refactor existing actions - #26529

Merged
Travis Plunk (TravisEz13) merged 1 commit into
PowerShell:release/v7.6from
TravisEz13:backport/release/v7.6/26355-a93688463
Nov 25, 2025
Merged

[release/v7.6] Add reusable get-changed-files action and refactor existing actions#26529
Travis Plunk (TravisEz13) merged 1 commit into
PowerShell:release/v7.6from
TravisEz13:backport/release/v7.6/26355-a93688463

Conversation

@TravisEz13

Copy link
Copy Markdown
Member

Backport of #26355 to release/v7.6

Triggered by Travis Plunk (@TravisEz13) on behalf of Travis Plunk (@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

  • Required tooling change
  • Optional tooling change (include reasoning)

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

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

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.

  • High
  • Medium
  • Low

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 checked file.filename instead of file. The refactored version uses the new file string 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.

…owerShell#26355)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings November 25, 2025 21:39
@TravisEz13Travis Plunk (TravisEz13) added the CL-Tools Indicates that a PR should be marked as a tools change in the Change Log label Nov 25, 2025

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-files action with pagination support, optional filtering, and support for both pull_request and push events
  • Security improvements: Refactored both path-filters and markdownlinks actions 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.

FileDescription
.github/actions/infrastructure/get-changed-files/action.ymlNew composite action that fetches changed files with pagination, filtering support, and hash-based verification
.github/actions/infrastructure/get-changed-files/README.mdComprehensive documentation for the new action including usage examples, input/output specifications, and pagination details
.github/actions/infrastructure/path-filters/action.ymlRefactored 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.ymlSimplified 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.

Comment thread.github/actions/infrastructure/get-changed-files/README.md
Comment thread.github/actions/infrastructure/path-filters/action.yml
Comment thread.github/actions/infrastructure/get-changed-files/README.md
Comment thread.github/actions/infrastructure/get-changed-files/action.yml
Comment thread.github/actions/infrastructure/get-changed-files/action.yml
Comment thread.github/actions/infrastructure/get-changed-files/README.md
Comment thread.github/actions/infrastructure/get-changed-files/README.md
CopilotAI 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>
@TravisEz13
Travis Plunk (TravisEz13) merged commit 0b313f7 into PowerShell:release/v7.6Nov 25, 2025
48 of 50 checks passed
@TravisEz13
Travis Plunk (TravisEz13) deleted the backport/release/v7.6/26355-a93688463 branch November 25, 2025 22:24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-ToolsIndicates that a PR should be marked as a tools change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@TravisEz13@SeeminglyScience