From bd22ad5500dac120ed80e62a4472757fb9de7f60 Mon Sep 17 00:00:00 2001 From: skidoodle Date: Sat, 31 Jan 2026 02:00:13 +0100 Subject: [PATCH] Add quick test and fix Windows clipboard check Run `go test -v ./...` in the release workflow before GoReleaser. In the Windows test job replace Get-Clipboard with System.Windows.Forms::GetFileDropList(), check for "$PWD\ctx.txt" and improve success/error output. --- .github/workflows/release.yaml | 4 ++++ .github/workflows/test.yaml | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ffd5754..9f10a1f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,6 +22,10 @@ jobs: with: go-version: stable + - name: Quick Sanity Check + shell: bash + run: go test -v ./... + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6 with: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index cbfc9f8..52c4e2a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -43,10 +43,11 @@ jobs: if: matrix.os == 'windows-latest' run: | ./ctx.exe . - $files = Get-Clipboard -Format FileDropList - if ($files) { - Write-Host "Clipboard contains: $files" - if ($files.Name -contains "ctx.txt") { exit 0 } + Add-Type -AssemblyName System.Windows.Forms + $files = [System.Windows.Forms.Clipboard]::GetFileDropList() + if ($files.Contains("$PWD\ctx.txt")) { + Write-Host "Success: Clipboard contains ctx.txt" + exit 0 } - Write-Error "Clipboard did not contain ctx.txt" + Write-Error "Clipboard did not contain ctx.txt. Found: $files" exit 1