Fix image tag: strip leading v from release tag (vv1.1.0 -> v1.1.0)
build / build (push) Successful in 6s

mcp-grafana GitHub releases are tagged v1.1.0, so prefixing v$VER
produced vv1.1.0. Normalize the tag to v<semver> for the Monday
image cron.
This commit is contained in:
2026-08-15 22:28:45 +00:00
parent 3299926acf
commit f720523cd7
+9 -5
View File
@@ -52,13 +52,16 @@ jobs:
fi
[ -n "$VER" ] || { echo "could not resolve upstream version"; exit 1; }
echo "version=$VER" >> "$GITHUB_OUTPUT"
# Image tag strips a leading 'v' from the release tag (v1.2.3 -> v1.2.3),
# so the tag is always v<semver> regardless of upstream's tag style.
echo "tag=${VER#v}" >> "$GITHUB_OUTPUT"
echo "Resolved grafana/mcp-grafana version: $VER"
- name: Skip if already published
id: skip
run: |
if docker manifest inspect "$IMAGE:v${{ steps.ver.outputs.version }}" >/dev/null 2>&1; then
echo "Image $IMAGE:v${{ steps.ver.outputs.version }} already exists — nothing to do."
if docker manifest inspect "$IMAGE:v${{ steps.ver.outputs.tag }}" >/dev/null 2>&1; then
echo "Image $IMAGE:v${{ steps.ver.outputs.tag }} already exists — nothing to do."
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
@@ -98,12 +101,13 @@ jobs:
if: steps.skip.outputs.skip != 'true'
run: |
VER="${{ steps.ver.outputs.version }}"
TAG="${{ steps.ver.outputs.tag }}"
docker build --build-arg MCP_GRAFANA_VERSION="$VER" \
-t "$IMAGE:v$VER" -t "$IMAGE:latest" .
-t "$IMAGE:v$TAG" -t "$IMAGE:latest" .
- name: Push
if: steps.skip.outputs.skip != 'true'
run: |
VER="${{ steps.ver.outputs.version }}"
docker push "$IMAGE:v$VER"
TAG="${{ steps.ver.outputs.tag }}"
docker push "$IMAGE:v$TAG"
docker push "$IMAGE:latest"