[release/v7.6] Fix merge conflict checker for empty file lists and filter *.cs files by adityapatwardhan · Pull Request #26556 · PowerShell/PowerShell · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/actions/infrastructure/merge-conflict-checker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 'Check for Merge Conflict Markers'
description: 'Checks for Git merge conflict markers in changed files for pull requests'
author: 'PowerShell Team'

outputs:
files-checked:
description: 'Number of files checked for merge conflict markers'
value: ${{ steps.check.outputs.files-checked }}
conflicts-found:
description: 'Number of files with merge conflict markers'
value: ${{ steps.check.outputs.conflicts-found }}

runs:
using: 'composite'
steps:
- name: Get changed files
id: changed-files
uses: "./.github/actions/infrastructure/get-changed-files"

- name: Check for merge conflict markers
id: check
shell: pwsh
env:
CHANGED_FILES_JSON: ${{ steps.changed-files.outputs.files }}
run: |
# Get changed files from environment variable (secure against injection)
$changedFilesJson = $env:CHANGED_FILES_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
Test-MergeConflictMarker -File $changedFiles -WorkspacePath $env:GITHUB_WORKSPACE

branding:
icon: 'alert-triangle'
color: 'red'
246 changes: 246 additions & 0 deletions test/infrastructure/ciModule.Tests.ps1
Loading
Loading