From b70f23f3ca5123d6723921d11aa1def830ab2068 Mon Sep 17 00:00:00 2001 From: Duncan Harvey Date: Fri, 23 Jan 2026 13:40:36 -0500 Subject: [PATCH] add package version override --- .github/workflows/publish.yaml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 0011d57..2a5c4c1 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -11,6 +11,11 @@ on: options: - "Build" - "Build and Publish" + package-version-override: + description: "Package version override (optional, x.y.z)" + required: false + type: string + default: "" permissions: {} @@ -24,11 +29,15 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - id: package run: | - if [[ ! "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Invalid tag format: $GITHUB_REF, must be in the form vMAJOR.MINOR.PATCH" - exit 1 + if [[ -n "${{ github.event.inputs.package-version-override }}" ]]; then + PACKAGE_VERSION="${{ github.event.inputs.package-version-override }}" + else + if [[ ! "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(-.+)?$ ]]; then + echo "Invalid tag format: $GITHUB_REF, must be in the form vMAJOR.MINOR.PATCH" + exit 1 + fi + PACKAGE_VERSION="${GITHUB_REF#refs/tags/v}" fi - PACKAGE_VERSION="${GITHUB_REF#refs/tags/v}" echo "package-version=$PACKAGE_VERSION" >> "$GITHUB_OUTPUT" - id: serverless-compat-binary