mirror of https://github.com/h44z/wg-portal.git
chore: build fix and generate display name
This commit is contained in:
parent
68723d5feb
commit
616858e46c
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue