From 1ead5e6d25bc444c6b5884d58769a71ba57de61e Mon Sep 17 00:00:00 2001 From: ergosteur <1992147+ergosteur@users.noreply.github.com> Date: Mon, 16 Mar 2026 12:54:47 -0400 Subject: [PATCH] Configure Git line endings and enhance script checks Added a step to configure Git line endings and improved the shell script to check for file existence before processing. --- .github/workflows/build.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d25b4bb..5a94ad7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,8 +15,10 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - with: - autocrlf: input + + # This replaces the invalid 'autocrlf' input + - name: Configure Git Line Endings + run: git config --global core.autocrlf input - name: Setup .NET uses: actions/setup-dotnet@v4 @@ -42,15 +44,18 @@ jobs: shell: pwsh run: | $path = "ssh-handler.sh" - $content = [System.IO.File]::ReadAllText((Get-Item $path).FullName) - $content = $content -replace "`r`n", "`n" - [System.IO.File]::WriteAllText((Get-Item $path).FullName, $content, (New-Object System.Text.UTF8Encoding($false))) + if (Test-Path $path) { + $content = [System.IO.File]::ReadAllText((Get-Item $path).FullName) + $content = $content -replace "`r`n", "`n" + [System.IO.File]::WriteAllText((Get-Item $path).FullName, $content, (New-Object System.Text.UTF8Encoding($false))) + Write-Host "Successfully converted $path to LF" + } - name: Prepare Assets with Versioning shell: pwsh run: | $tag = "${{ github.ref_name }}" - if (-not $tag) { $tag = "manual" } + if (-not $tag -or $tag -eq "main") { $tag = "manual" } # Rename Executables Move-Item ./publish-standalone/SshHandler.exe "./SshHandler-$tag-Standalone.exe"