Fix empty tag in dispatched Windows builds
All checks were successful
Release / Bump version and tag (push) Successful in 7s
All checks were successful
Release / Bump version and tag (push) Successful in 7s
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) <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,10 @@ jobs:
|
|||||||
- name: Determine tag
|
- name: Determine tag
|
||||||
id: tag
|
id: tag
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ github.event.inputs.tag }}"
|
TAG="${{ inputs.tag }}"
|
||||||
|
if [ -z "$TAG" ]; then
|
||||||
|
TAG="${{ github.event.inputs.tag }}"
|
||||||
|
fi
|
||||||
if [ -z "$TAG" ]; then
|
if [ -z "$TAG" ]; then
|
||||||
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||')
|
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||')
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -17,7 +17,10 @@ jobs:
|
|||||||
- name: Determine tag
|
- name: Determine tag
|
||||||
id: tag
|
id: tag
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ github.event.inputs.tag }}"
|
TAG="${{ inputs.tag }}"
|
||||||
|
if [ -z "$TAG" ]; then
|
||||||
|
TAG="${{ github.event.inputs.tag }}"
|
||||||
|
fi
|
||||||
if [ -z "$TAG" ]; then
|
if [ -z "$TAG" ]; then
|
||||||
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||')
|
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||')
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -16,14 +16,17 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Determine tag
|
- name: Determine tag
|
||||||
id: tag
|
id: tag
|
||||||
shell: powershell
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
$TAG = "${{ github.event.inputs.tag }}"
|
TAG="${{ inputs.tag }}"
|
||||||
if (-not $TAG) {
|
if [ -z "$TAG" ]; then
|
||||||
$TAG = (git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | Select-Object -First 1) -replace '.*refs/tags/', ''
|
TAG="${{ github.event.inputs.tag }}"
|
||||||
}
|
fi
|
||||||
Write-Host "Building for tag: ${TAG}"
|
if [ -z "$TAG" ]; then
|
||||||
echo "tag=${TAG}" >> $env:GITHUB_OUTPUT
|
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
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -17,7 +17,10 @@ jobs:
|
|||||||
- name: Determine tag
|
- name: Determine tag
|
||||||
id: tag
|
id: tag
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ github.event.inputs.tag }}"
|
TAG="${{ inputs.tag }}"
|
||||||
|
if [ -z "$TAG" ]; then
|
||||||
|
TAG="${{ github.event.inputs.tag }}"
|
||||||
|
fi
|
||||||
if [ -z "$TAG" ]; then
|
if [ -z "$TAG" ]; then
|
||||||
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | head -1 | sed 's|.*refs/tags/||')
|
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | head -1 | sed 's|.*refs/tags/||')
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -17,7 +17,10 @@ jobs:
|
|||||||
- name: Determine tag
|
- name: Determine tag
|
||||||
id: tag
|
id: tag
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ github.event.inputs.tag }}"
|
TAG="${{ inputs.tag }}"
|
||||||
|
if [ -z "$TAG" ]; then
|
||||||
|
TAG="${{ github.event.inputs.tag }}"
|
||||||
|
fi
|
||||||
if [ -z "$TAG" ]; then
|
if [ -z "$TAG" ]; then
|
||||||
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | head -1 | sed 's|.*refs/tags/||')
|
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | head -1 | sed 's|.*refs/tags/||')
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -16,14 +16,17 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Determine tag
|
- name: Determine tag
|
||||||
id: tag
|
id: tag
|
||||||
shell: powershell
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
$TAG = "${{ github.event.inputs.tag }}"
|
TAG="${{ inputs.tag }}"
|
||||||
if (-not $TAG) {
|
if [ -z "$TAG" ]; then
|
||||||
$TAG = (git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | Select-Object -First 1) -replace '.*refs/tags/', ''
|
TAG="${{ github.event.inputs.tag }}"
|
||||||
}
|
fi
|
||||||
Write-Host "Building for tag: ${TAG}"
|
if [ -z "$TAG" ]; then
|
||||||
echo "tag=${TAG}" >> $env:GITHUB_OUTPUT
|
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
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user