mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
[release/v7.5] Fix merge conflict checker for empty file lists and filter *.cs files (#26813)
This commit is contained in:
@@ -56,8 +56,10 @@ jobs:
|
||||
- **File Handling**:
|
||||
- Checks only files that were added, modified, or renamed
|
||||
- Skips deleted files
|
||||
- **Filters out `*.cs` files** (C# files are excluded from merge conflict checking)
|
||||
- Skips binary/unreadable files
|
||||
- Skips directories
|
||||
- **Empty File List**: Gracefully handles cases where no files need checking (e.g., PRs that only delete files)
|
||||
|
||||
## Example Output
|
||||
|
||||
|
||||
@@ -25,7 +25,8 @@ runs:
|
||||
run: |
|
||||
# Get changed files from environment variable (secure against injection)
|
||||
$changedFilesJson = $env:CHANGED_FILES_JSON
|
||||
$changedFiles = $changedFilesJson | ConvertFrom-Json
|
||||
# Ensure we always have an array (ConvertFrom-Json returns null for empty JSON arrays)
|
||||
$changedFiles = @($changedFilesJson | ConvertFrom-Json)
|
||||
|
||||
# Import ci.psm1 and run the check
|
||||
Import-Module "$env:GITHUB_WORKSPACE/tools/ci.psm1" -Force
|
||||
|
||||
Reference in New Issue
Block a user