From f408f94e662aa5f8d6f610aa1b72bb0daf1ba1c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=83=E5=B7=9D=E7=99=BD=E6=B5=AA?= <1679659@qq.com> Date: Sat, 5 Dec 2026 02:10:20 -0700 Subject: [PATCH] ci(release): allow dispatching the package build for an existing tag A tag push occasionally fails to start this workflow, which leaves the release with no package. Dispatching with an existing tag rebuilds the same package from that tag instead of waiting for another push. --- .github/workflows/release.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86319c5..4fd1a6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,14 @@ name: Release plugin package on: push: tags: ['v*'] + # A tag push can occasionally fail to start this workflow. Dispatching with + # an existing tag rebuilds the same package from that tag. + workflow_dispatch: + inputs: + tag: + description: 'Existing tag to package and release' + required: true + type: string permissions: contents: write @@ -10,8 +18,12 @@ permissions: jobs: package: runs-on: windows-latest + env: + RELEASE_TAG: ${{ inputs.tag || github.ref_name }} steps: - uses: actions/checkout@v4 + with: + ref: ${{ env.RELEASE_TAG }} - uses: actions/setup-go@v6 with: go-version-file: go.mod @@ -55,7 +67,7 @@ jobs: id: package shell: pwsh run: | - $tag = '${{ github.ref_name }}' + $tag = $env:RELEASE_TAG $version = $tag.Substring(1) $manifest = Get-Content -Raw plugin.json | ConvertFrom-Json if ($manifest.version -ne $version) { throw "Tag $tag does not match plugin.json version $($manifest.version)" } @@ -76,4 +88,4 @@ jobs: GH_TOKEN: ${{ github.token }} shell: pwsh run: | - gh release create "${{ github.ref_name }}" "${{ steps.package.outputs.zip_path }}" "${{ steps.package.outputs.sha_path }}" --verify-tag --generate-notes + gh release create "$env:RELEASE_TAG" "${{ steps.package.outputs.zip_path }}" "${{ steps.package.outputs.sha_path }}" --verify-tag --generate-notes