Skip to content

Commit

Permalink
Fix yq test to not create empty commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eleftherias committed Jan 3, 2025
1 parent bd96e48 commit 4ce586e
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"go.uber.org/mock/gomock"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/types/known/structpb"

"github.com/mindersec/minder/internal/engine/errors"
"github.com/mindersec/minder/internal/engine/interfaces"
Expand Down Expand Up @@ -140,6 +141,35 @@ func yqPrRem() *pb.RuleType_Definition_Remediate_PullRequestRemediation {
Method: "minder.yq.evaluate",
Title: yqCommitTitle,
Body: yqPrBody,
Params: &structpb.Struct{
Fields: map[string]*structpb.Value{
"expression": {
Kind: &structpb.Value_StringValue{
StringValue: ".on = \"workflow_dispatch\"",
},
},
"patterns": {
Kind: &structpb.Value_ListValue{
ListValue: &structpb.ListValue{
Values: []*structpb.Value{
structpb.NewStructValue(&structpb.Struct{
Fields: map[string]*structpb.Value{
"pattern": structpb.NewStringValue(".github/workflows/*.yml"),
"type": structpb.NewStringValue("glob"),
},
}),
structpb.NewStructValue(&structpb.Struct{
Fields: map[string]*structpb.Value{
"pattern": structpb.NewStringValue(".github/workflows/*.yaml"),
"type": structpb.NewStringValue("glob"),
},
}),
},
},
},
},
},
},
}
}

Expand Down

0 comments on commit 4ce586e

Please sign in to comment.