From b73b23b02dc33b13c15a567a5db15f713dcc55b4 Mon Sep 17 00:00:00 2001 From: Jon Langevin Date: Mon, 1 Jun 2026 13:22:46 -0400 Subject: [PATCH 1/2] chore: apply plugin version discipline --- .github/workflows/release.yml | 2 ++ internal/plugin_test.go | 15 +++++++++++++-- plugin.json | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5091dde..235680f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,6 +58,8 @@ jobs: exit 0 fi "${{ runner.temp }}/wfctl-bin/wfctl" plugin verify-capabilities --binary "$BIN" .goreleaser-tmp + - name: Verify shipped plugin.json carries tag (post-build) + run: "${{ runner.temp }}/wfctl-bin/wfctl plugin validate-contract --for-publish --tag ${{ github.ref_name }} --release-dir .goreleaser-tmp ." - name: Publish GitHub release uses: actions/github-script@v7 diff --git a/internal/plugin_test.go b/internal/plugin_test.go index 15a22e7..791c8b6 100644 --- a/internal/plugin_test.go +++ b/internal/plugin_test.go @@ -194,7 +194,11 @@ func TestPluginDownloadsMatchGoReleaserMatrix(t *testing.T) { for _, goos := range build.Goos { for _, goarch := range build.Goarch { key := goos + "/" + goarch - want[key] = fmt.Sprintf("https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/v%s/workflow-plugin-discord-%s-%s.tar.gz", manifest.Version, goos, goarch) + if manifest.Version == "0.0.0" { + want[key] = fmt.Sprintf("workflow-plugin-discord-%s-%s.tar.gz", goos, goarch) + } else { + want[key] = fmt.Sprintf("https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/v%s/workflow-plugin-discord-%s-%s.tar.gz", manifest.Version, goos, goarch) + } } } @@ -206,7 +210,14 @@ func TestPluginDownloadsMatchGoReleaserMatrix(t *testing.T) { t.Fatalf("download matrix = %v, want %v", got, want) } for key, wantURL := range want { - if gotURL := got[key]; gotURL != wantURL { + gotURL := got[key] + if manifest.Version == "0.0.0" { + if !strings.HasSuffix(gotURL, wantURL) || strings.Contains(gotURL, "/releases/download/v0.0.0/") { + t.Fatalf("download %s = %q, want released artifact suffix %q without sentinel URL", key, gotURL, wantURL) + } + continue + } + if gotURL != wantURL { t.Fatalf("download %s = %q, want %q", key, gotURL, wantURL) } } diff --git a/plugin.json b/plugin.json index 37dfb85..2b1315f 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "discord", - "version": "0.1.2", + "version": "0.0.0", "author": "GoCodeAlone", "description": "Discord messaging, bots, and voice", "type": "external", From 4afde839b58d3640780fb15d52ff6d790dd30ab3 Mon Sep 17 00:00:00 2001 From: Jon Langevin Date: Mon, 1 Jun 2026 13:29:57 -0400 Subject: [PATCH 2/2] fix: strengthen sentinel download test --- internal/plugin_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/plugin_test.go b/internal/plugin_test.go index 791c8b6..3b63662 100644 --- a/internal/plugin_test.go +++ b/internal/plugin_test.go @@ -212,8 +212,11 @@ func TestPluginDownloadsMatchGoReleaserMatrix(t *testing.T) { for key, wantURL := range want { gotURL := got[key] if manifest.Version == "0.0.0" { - if !strings.HasSuffix(gotURL, wantURL) || strings.Contains(gotURL, "/releases/download/v0.0.0/") { - t.Fatalf("download %s = %q, want released artifact suffix %q without sentinel URL", key, gotURL, wantURL) + const releasesPrefix = "https://github.com/GoCodeAlone/workflow-plugin-discord/releases/download/" + if !strings.HasPrefix(gotURL, releasesPrefix) || + !strings.HasSuffix(gotURL, wantURL) || + strings.Contains(gotURL, "/releases/download/v0.0.0/") { + t.Fatalf("download %s = %q, want GitHub Releases URL with artifact suffix %q without sentinel URL", key, gotURL, wantURL) } continue }