Skip to content

Commit 5cb86b2

Browse files
committed
pass git tag ref name as built-in version arg
1 parent 7ef34f5 commit 5cb86b2

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

.github/workflows/pr.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ jobs:
3737
username: ${{ vars.DOCKER_HUB_API_USER || secrets.DOCKER_HUB_API_USER }}
3838
password: ${{ secrets.DOCKER_HUB_API_TOKEN }}
3939

40-
- name: Check Run ID
41-
run: echo ${{ github.run_id }}
42-
4340
- name: Build and push
4441
uses: docker/build-push-action@v6
4542
with:
@@ -199,9 +196,6 @@ jobs:
199196
- name: Checkout
200197
uses: actions/checkout@v4
201198

202-
- name: Check Run ID
203-
run: echo ${{ github.run_id }}
204-
205199
- name: install-kubectl
206200
uses: azure/setup-kubectl@v3
207201
with:

.github/workflows/pre-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ jobs:
5959
cache-to: type=registry,ref=${{ env.IMAGE_REPO }}:build,mode=max
6060
labels: ${{ steps.meta.outputs.labels }}
6161
tags: ${{ steps.meta.outputs.tags }}
62+
build-args: VERSION=${{ github.ref_name }}
6263
push: true
6364

6465
- name: Generate artifact attestation

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM golang:1.23 AS build-stage
33
WORKDIR /app
44

55
# Version can be passed as --build-arg VERSION=$(git describe --tags --always)
6-
ARG VERSION=development
6+
ARG VERSION=v0.0.0
77
COPY . .
88
RUN --mount=type=cache,target=/go/pkg/mod \
99
--mount=type=cache,target=/root/.cache/go-build \

0 commit comments

Comments
 (0)