From f3843d59f1f120ae9e4b80a79027b79fad346658 Mon Sep 17 00:00:00 2001 From: Developer Date: Mon, 6 Apr 2026 18:59:15 -0700 Subject: [PATCH] Fix empty tag in dispatched Windows builds The workflow_dispatch input was accessed as github.event.inputs.tag which can be empty depending on the Gitea runner. Now tries both inputs.tag (modern syntax) and github.event.inputs.tag as fallback, with a final fallback to the latest matching git tag. Also switched Windows Determine-tag steps from PowerShell to bash (via Git Bash) for consistency with the other platforms. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitea/workflows/build-app-linux.yml | 5 ++++- .gitea/workflows/build-app-macos.yml | 5 ++++- .gitea/workflows/build-app-windows.yml | 17 ++++++++++------- .gitea/workflows/build-sidecar-linux.yml | 5 ++++- .gitea/workflows/build-sidecar-macos.yml | 5 ++++- .gitea/workflows/build-sidecar-windows.yml | 17 ++++++++++------- 6 files changed, 36 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/build-app-linux.yml b/.gitea/workflows/build-app-linux.yml index 1964818..b0d8964 100644 --- a/.gitea/workflows/build-app-linux.yml +++ b/.gitea/workflows/build-app-linux.yml @@ -17,7 +17,10 @@ jobs: - name: Determine tag id: tag run: | - TAG="${{ github.event.inputs.tag }}" + TAG="${{ inputs.tag }}" + if [ -z "$TAG" ]; then + TAG="${{ github.event.inputs.tag }}" + fi if [ -z "$TAG" ]; then TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||') fi diff --git a/.gitea/workflows/build-app-macos.yml b/.gitea/workflows/build-app-macos.yml index 5a34a57..38ba639 100644 --- a/.gitea/workflows/build-app-macos.yml +++ b/.gitea/workflows/build-app-macos.yml @@ -17,7 +17,10 @@ jobs: - name: Determine tag id: tag run: | - TAG="${{ github.event.inputs.tag }}" + TAG="${{ inputs.tag }}" + if [ -z "$TAG" ]; then + TAG="${{ github.event.inputs.tag }}" + fi if [ -z "$TAG" ]; then TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||') fi diff --git a/.gitea/workflows/build-app-windows.yml b/.gitea/workflows/build-app-windows.yml index 46897ab..8001ff9 100644 --- a/.gitea/workflows/build-app-windows.yml +++ b/.gitea/workflows/build-app-windows.yml @@ -16,14 +16,17 @@ jobs: steps: - name: Determine tag id: tag - shell: powershell + shell: bash run: | - $TAG = "${{ github.event.inputs.tag }}" - if (-not $TAG) { - $TAG = (git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | Select-Object -First 1) -replace '.*refs/tags/', '' - } - Write-Host "Building for tag: ${TAG}" - echo "tag=${TAG}" >> $env:GITHUB_OUTPUT + TAG="${{ inputs.tag }}" + if [ -z "$TAG" ]; then + TAG="${{ github.event.inputs.tag }}" + fi + if [ -z "$TAG" ]; then + TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||') + fi + echo "Building for tag: ${TAG}" + echo "tag=${TAG}" >> $GITHUB_OUTPUT - uses: actions/checkout@v4 with: diff --git a/.gitea/workflows/build-sidecar-linux.yml b/.gitea/workflows/build-sidecar-linux.yml index 33d4ba7..c9a604a 100644 --- a/.gitea/workflows/build-sidecar-linux.yml +++ b/.gitea/workflows/build-sidecar-linux.yml @@ -17,7 +17,10 @@ jobs: - name: Determine tag id: tag run: | - TAG="${{ github.event.inputs.tag }}" + TAG="${{ inputs.tag }}" + if [ -z "$TAG" ]; then + TAG="${{ github.event.inputs.tag }}" + fi if [ -z "$TAG" ]; then TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | head -1 | sed 's|.*refs/tags/||') fi diff --git a/.gitea/workflows/build-sidecar-macos.yml b/.gitea/workflows/build-sidecar-macos.yml index 5398ccb..84e060b 100644 --- a/.gitea/workflows/build-sidecar-macos.yml +++ b/.gitea/workflows/build-sidecar-macos.yml @@ -17,7 +17,10 @@ jobs: - name: Determine tag id: tag run: | - TAG="${{ github.event.inputs.tag }}" + TAG="${{ inputs.tag }}" + if [ -z "$TAG" ]; then + TAG="${{ github.event.inputs.tag }}" + fi if [ -z "$TAG" ]; then TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | head -1 | sed 's|.*refs/tags/||') fi diff --git a/.gitea/workflows/build-sidecar-windows.yml b/.gitea/workflows/build-sidecar-windows.yml index 76545d2..4c7cf4b 100644 --- a/.gitea/workflows/build-sidecar-windows.yml +++ b/.gitea/workflows/build-sidecar-windows.yml @@ -16,14 +16,17 @@ jobs: steps: - name: Determine tag id: tag - shell: powershell + shell: bash run: | - $TAG = "${{ github.event.inputs.tag }}" - if (-not $TAG) { - $TAG = (git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | Select-Object -First 1) -replace '.*refs/tags/', '' - } - Write-Host "Building for tag: ${TAG}" - echo "tag=${TAG}" >> $env:GITHUB_OUTPUT + TAG="${{ inputs.tag }}" + if [ -z "$TAG" ]; then + TAG="${{ github.event.inputs.tag }}" + fi + if [ -z "$TAG" ]; then + TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | head -1 | sed 's|.*refs/tags/||') + fi + echo "Building for tag: ${TAG}" + echo "tag=${TAG}" >> $GITHUB_OUTPUT - uses: actions/checkout@v4 with: