Revert "Tag pipeline with source information (#4771)" (#4794)

This commit is contained in:
Robert Kaussow
2025-01-31 13:53:41 +01:00
committed by GitHub
parent cfbb3ecf68
commit 00aa968afa
6 changed files with 9 additions and 40 deletions

View File

@@ -19,7 +19,6 @@ import (
"fmt"
"maps"
"path/filepath"
"strconv"
"strings"
"github.com/oklog/ulid/v2"
@@ -195,20 +194,6 @@ func (b *StepBuilder) genItemForWorkflow(workflow *model.Workflow, axis matrix.A
maps.Copy(item.Labels, b.DefaultLabels)
}
// "woodpecker-ci.org" namespace is reserved for internal use
for key := range item.Labels {
if strings.HasPrefix(key, "woodpecker-ci.org") {
log.Debug().Str("forge", b.Forge.Name()).Str("repo", b.Repo.FullName).Str("label", key).Msg("dropped pipeline label with reserved prefix woodpecker-ci.org")
delete(item.Labels, key)
}
}
item.Labels["woodpecker-ci.org/forge-id"] = b.Forge.Name()
item.Labels["woodpecker-ci.org/repo-forge-id"] = string(b.Repo.ForgeRemoteID)
item.Labels["woodpecker-ci.org/repo-id"] = strconv.FormatInt(b.Repo.ID, 10)
item.Labels["woodpecker-ci.org/repo-name"] = b.Repo.Name
item.Labels["woodpecker-ci.org/branch"] = b.Repo.Branch
return item, errorsAndWarnings
}