[release/v7.6.6] Localized file check-in by OneLocBuild Task: Build definition ID 13420: Build ID 2652124 by SeeminglyScience · Pull Request #27918 · 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 13 additions & 0 deletions .github/actions/infrastructure/get-changed-files/action.yml
12 changes: 8 additions & 4 deletions .github/actions/infrastructure/markdownlinks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@ runs:
id: verify
shell: pwsh
env:
CHANGED_FILES_JSON: ${{ steps.changed-files.outputs.files }}
CHANGED_FILES_PATH: ${{ steps.changed-files.outputs.files_path }}
run: |
Write-Host "Starting markdown link verification..." -ForegroundColor Cyan

# Get changed markdown files from environment variable (secure against injection)
$changedFilesJson = $env:CHANGED_FILES_JSON
$changedFiles = $changedFilesJson | ConvertFrom-Json
# Read changed markdown files from temp file to avoid ARG_MAX limits with large PRs
$changedFilesPath = $env:CHANGED_FILES_PATH
if ($changedFilesPath -and (Test-Path $changedFilesPath)) {
$changedFiles = @(Get-Content $changedFilesPath -Raw | ConvertFrom-Json)
} else {
$changedFiles = @()
}
Comment on lines +48 to +53

if ($changedFiles.Count -eq 0) {
Write-Host "No markdown files changed, skipping verification" -ForegroundColor Yellow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ runs:
id: check
shell: pwsh
env:
CHANGED_FILES_JSON: ${{ steps.changed-files.outputs.files }}
CHANGED_FILES_PATH: ${{ steps.changed-files.outputs.files_path }}
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)
# Read changed files from temp file to avoid ARG_MAX limits with large PRs
$changedFilesPath = $env:CHANGED_FILES_PATH
if ($changedFilesPath -and (Test-Path $changedFilesPath)) {
$changedFiles = @(Get-Content $changedFilesPath -Raw | ConvertFrom-Json)
} else {
$changedFiles = @()
}
Comment on lines +27 to +32

# Import ci.psm1 and run the check
Import-Module "$env:GITHUB_WORKSPACE/tools/ci.psm1" -Force
Expand Down
13 changes: 10 additions & 3 deletions .github/actions/infrastructure/path-filters/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ runs:
id: filter
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
env:
FILES_JSON: ${{ steps.get-files.outputs.files }}
FILES_PATH: ${{ steps.get-files.outputs.files_path }}
with:
github-token: ${{ inputs.GITHUB_TOKEN }}
script: |
Expand All @@ -60,8 +60,15 @@ runs:
return;
}

// Get files from environment variable (secure against injection)
const files = JSON.parse(process.env.FILES_JSON || '[]');
// Read files from temp file to avoid ARG_MAX limits with large PRs
const fs = require('fs');
const filesPath = process.env.FILES_PATH;
let files = [];
if (filesPath && fs.existsSync(filesPath)) {
files = JSON.parse(fs.readFileSync(filesPath, 'utf8'));
} else {
console.log('Warning: files_path not found, no files to analyze');
}
Comment on lines +63 to +71

// Calculate hash for verification (matches get-changed-files action)
const crypto = require('crypto');
Expand Down
Loading
Loading