Skip to content

Commit 4f8134f

Browse files
natemcmasterclaude
andcommitted
fix: normalize line endings in PowerShell scripts
The docs/push.ps1 script had CRLF line endings, causing the GitHub Actions workflow to fail with "pwsh\r: No such file or directory" on Linux runners. - Convert docs/push.ps1 to LF line endings - Add *.ps1 eol=lf to .gitattributes to prevent recurrence 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 66821d9 commit 4f8134f

2 files changed

Lines changed: 36 additions & 35 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@
5050
*.sln text=auto eol=crlf
5151

5252
*.sh eol=lf
53+
*.ps1 eol=lf

docs/push.ps1

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
#!/usr/bin/env pwsh
2-
param(
3-
[string]$SourceCommit,
4-
[string]$ApiToken,
5-
[switch]$DryRun
6-
)
7-
8-
$ErrorActionPreference = 'Stop'
9-
Set-StrictMode -Version 2
10-
11-
Import-Module -Force -Scope Local "$PSScriptRoot/../src/common.psm1"
12-
13-
$workdir = "$PSScriptRoot/../.build/docs/gh-pages"
14-
Push-Location $workdir
15-
try {
16-
17-
if ($env:CI) {
18-
exec git config --global credential.helper store
19-
Add-Content "$HOME\.git-credentials" "https://x-access-token:${ApiToken}@github.com`n"
20-
exec git config --global user.email 'actions@users.noreply.github.com'
21-
exec git config --global user.name "GitHub Workflow (${env:GITHUB_ACTOR})"
22-
$SourceCommit = $env:GITHUB_SHA
23-
}
24-
25-
if (-not $SourceCommit) {
26-
Push-Location $PSScriptRoot
27-
$SourceCommit = $(git rev-parse HEAD)
28-
Pop-Location
29-
}
30-
exec git commit --allow-empty -m "Generate documentation from $SourceCommit"
31-
exec git push --quiet origin gh-pages
32-
}
33-
finally {
34-
Pop-Location
35-
}
1+
#!/usr/bin/env pwsh
2+
param(
3+
[string]$SourceCommit,
4+
[string]$ApiToken,
5+
[switch]$DryRun
6+
)
7+
8+
$ErrorActionPreference = 'Stop'
9+
Set-StrictMode -Version 2
10+
11+
Import-Module -Force -Scope Local "$PSScriptRoot/../src/common.psm1"
12+
13+
$workdir = "$PSScriptRoot/../.build/docs/gh-pages"
14+
Push-Location $workdir
15+
try {
16+
17+
if ($env:CI) {
18+
exec git config --global credential.helper store
19+
Add-Content "$HOME\.git-credentials" "https://x-access-token:${ApiToken}@github.com`n"
20+
exec git config --global user.email 'actions@users.noreply.github.com'
21+
exec git config --global user.name "GitHub Workflow (${env:GITHUB_ACTOR})"
22+
$SourceCommit = $env:GITHUB_SHA
23+
}
24+
25+
if (-not $SourceCommit) {
26+
Push-Location $PSScriptRoot
27+
$SourceCommit = $(git rev-parse HEAD)
28+
Pop-Location
29+
}
30+
exec git commit --allow-empty -m "Generate documentation from $SourceCommit"
31+
exec git push --quiet origin gh-pages
32+
}
33+
finally {
34+
Pop-Location
35+
}

0 commit comments

Comments
 (0)