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
TravisEz13
added
CL-BuildPackaging
and removed CL-BuildPackaging
labels
TravisEz13
deleted the
refactor/add-reusable-get-changed-files-action
branch
TravisEz13 added a commit to TravisEz13/PowerShell that referenced this pull request
…owerShell#26355) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
SIRMARGIN pushed a commit to SIRMARGIN/PowerShell that referenced this pull request
…owerShell#26355) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
kilasuit pushed a commit to kilasuit/PowerShell that referenced this pull request
…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
…owerShell#26355) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
JustinGrote pushed a commit to JustinGrote/PowerShell that referenced this pull request
…owerShell#26355) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>