Skip to content

Commit

Permalink
fix: set metadata when not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Sep 19, 2024
1 parent 9820efc commit 29e12dd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/native/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
yml "gopkg.in/yaml.v3"

api "github.com/go-vela/server/api/types"
"github.com/go-vela/server/internal"
"github.com/go-vela/types/constants"
"github.com/go-vela/types/library"
"github.com/go-vela/types/pipeline"
Expand Down Expand Up @@ -61,6 +62,11 @@ func (c *client) Compile(ctx context.Context, v interface{}) (*pipeline.Build, *
event = event + ":" + action
}

// populate metadata when not provided using compiler.WithMetadata
if c.metadata == nil {
c.metadata = &internal.Metadata{Database: &internal.Database{}, Queue: &internal.Queue{}, Source: &internal.Source{}, Vela: &internal.Vela{}}
}

// create the ruledata to purge steps
r := &pipeline.RuleData{
Branch: c.build.GetBranch(),
Expand Down

0 comments on commit 29e12dd

Please sign in to comment.