From 22c01b54b8402083487574841e5ada3ba4e0b221 Mon Sep 17 00:00:00 2001 From: Noah Theus Date: Mon, 13 Oct 2025 17:27:26 +0200 Subject: [PATCH] chore: Only tag images with branchname if changes are on master branch --- .github/workflows/on-push.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index cd0ef2e..7a7f607 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -8,6 +8,7 @@ on: - 'go.sum' - 'Dockerfile' - '.github/workflows/**' + jobs: docker: runs-on: ubuntu-latest @@ -21,14 +22,14 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: - username: ${{secrets.DOCKERHUB_USERNAME}} - password: ${{secrets.DOCKERHUB_TOKEN}} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v6 with: - platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/riscv64 + platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/riscv64 push: true tags: | - ${{ github.repository }}:${{ github.ref_name }} - ${{ github.repository }}:commit-${{ github.sha }} \ No newline at end of file + ${{ github.repository }}:commit-${{ github.sha }} + ${{ github.ref_name == 'master' && format('{0}:{1}', github.repository, github.ref_name) || '' }}