From 616858e46c58e8ee6d30f9f9f693a9de2571c025 Mon Sep 17 00:00:00 2001 From: fedorHub Date: Wed, 27 Aug 2025 11:52:17 +0200 Subject: [PATCH] chore: build fix and generate display name --- .DS_Store | Bin 0 -> 6148 bytes .github/workflows/docker-publish.yml | 8 ++++++-- internal/domain/peer.go | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..429a3d69a2c22c3f2235818c58d923aea4176a94 GIT binary patch literal 6148 zcmeHKOR54v3{2F;fE$-C`wHHm5#I^CfPx}|j37_fvwG+9XjVRmGP-%-Mk z)M7Fb5uKkmGm(jiG;l-tv(Ps?H}BaXGYW*`j+3;qmcwOvYJ1hM6UJ?158khAANhx4 zyNi2Y6Pcv~RDcRl0V+TR{-uERURW~@WTXOAfC}6du6(HuTBpR75ds6QR|7cUpBfs9mu3Op+? zjP1nw{}24l{QpeijtWqLuTnrqi{)aDSIXYndpYa11-^n?%@uBjwNnth9Rs}`V`J@j d>P1mkY>o4p*abQrd8Y&UGhn*VsKBQcxB<7=6{7$E literal 0 HcmV?d00001 diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7112ad0..2b27cf7 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -37,11 +37,15 @@ jobs: with: images: ghcr.io/${{ github.repository }} tags: | - type=ref,event=branch,enable=true - type=ref,event=tag,enable=true + type=ref,event=tag + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} + type=semver,pattern=v{{version}} + type=semver,pattern=v{{major}}.{{minor}} + type=semver,pattern=v{{major}} + type=sha,format=short - name: Build and push Docker image uses: docker/build-push-action@v6 diff --git a/internal/domain/peer.go b/internal/domain/peer.go index 519d551..769730d 100644 --- a/internal/domain/peer.go +++ b/internal/domain/peer.go @@ -123,8 +123,11 @@ func (p *Peer) ApplyInterfaceDefaults(in *Interface) { } func (p *Peer) GenerateDisplayName(prefix string) { + if p.DisplayName != "" { + return + } if prefix != "" { - prefix = fmt.Sprintf("%s ", strings.TrimSpace(prefix)) // add a space after the prefix + prefix = fmt.Sprintf("%s ", strings.TrimSpace(prefix)) } p.DisplayName = fmt.Sprintf("%sPeer %s", prefix, internal.TruncateString(string(p.Identifier), 8)) }