◐ Shell
clean mode source ↗

Add reusable get-changed-files action and refactor existing actions by TravisEz13 · Pull Request #26355 · PowerShell/PowerShell

- Create new .github/actions/infrastructure/get-changed-files composite action
  - Supports both pull_request and push events
  - Optional filtering by file pattern (e.g., '*.md', '.github/')
  - Full pagination support (fetches all changed files, not just first 100)
  - Returns JSON array of file paths for easy consumption

- Refactor markdownlinks action to use get-changed-files
  - Reduced from 108 lines to 77 lines (29% reduction)
  - Eliminated 31 lines of duplicate file retrieval code
  - Uses secure environment variable instead of direct string interpolation

- Refactor path-filters action to use get-changed-files
  - Reduced from 130 lines to 123 lines
  - Eliminated 15+ lines of duplicate pagination logic
  - Fixed JSON security issue: now uses fromJSON() instead of unsafe JSON.parse()
  - Added detailed logging for filter analysis
  - Proper escaping prevents potential code injection from filenames

Benefits:
- Eliminates ~60 lines of duplicate code across actions
- Centralizes file retrieval logic in one place
- Improves security with proper JSON handling
- Ensures consistent behavior across all actions using changed files
- Full pagination ensures no files are missed in large PRs

AI review requested due to automatic review settings

October 30, 2025 20:51

TravisEz13

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…able-get-changed-files-action

@TravisEz13 TravisEz13 added CL-BuildPackaging

Indicates that a PR should be marked as a build or packaging change in the Change Log

CL-Tools

Indicates that a PR should be marked as a tools change in the Change Log

and removed CL-BuildPackaging

Indicates that a PR should be marked as a build or packaging change in the Change Log

labels

Oct 30, 2025

adityapatwardhan

@TravisEz13 TravisEz13 deleted the refactor/add-reusable-get-changed-files-action branch

October 30, 2025 21:29

pwshBot pushed a commit to pwshBot/PowerShell that referenced this pull request

Oct 31, 2025

TravisEz13 added a commit to TravisEz13/PowerShell that referenced this pull request

Nov 25, 2025
…owerShell#26355)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

SIRMARGIN pushed a commit to SIRMARGIN/PowerShell that referenced this pull request

Dec 12, 2025
…owerShell#26355)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

kilasuit pushed a commit to kilasuit/PowerShell that referenced this pull request

Jan 2, 2026
…owerShell#26355)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

daxian-dbw pushed a commit to daxian-dbw/PowerShell that referenced this pull request

Feb 13, 2026
…owerShell#26355)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

JustinGrote pushed a commit to JustinGrote/PowerShell that referenced this pull request

Jun 2, 2026
…owerShell#26355)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>