Skip to content

Commit f05b12d

Browse files
committed
fix branch name
1 parent 0d85ae7 commit f05b12d

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/build-image-builder.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,31 @@ on:
77
pull_request:
88

99
env:
10-
TAG: ${{ github.ref_name }}
1110
IMAGE_NAME: image-builder
12-
REGISTRY: ghcr.io/elastisys
11+
REGISTRY: ghcr.io/elastisys
1312

1413
jobs:
1514
build-image-builder:
1615
runs-on: ubuntu-24.04
1716
steps:
1817
- uses: actions/checkout@v5
1918

19+
- name: Get branch name
20+
id: get-branch-name
21+
run: |
22+
if [ "${{ github.event_name }}" == "pull_request" ]; then
23+
echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_OUTPUT
24+
else
25+
echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
26+
fi
27+
shell: bash
28+
2029
- name: run make docker-build
2130
run: make docker-build
31+
env:
32+
TAG: ${{ steps.get-branch-name.outputs.BRANCH_NAME }}-${{ github.sha }}
2233

2334
- name: run make docker-push
2435
run: make docker-push
25-
36+
env:
37+
TAG: ${{ steps.get-branch-name.outputs.BRANCH_NAME }}-${{ github.sha }}

0 commit comments

Comments
 (0)