From 91381b5224e0b55a0b03f6b8280df9abaa14383f Mon Sep 17 00:00:00 2001 From: Eleftheria Stein-Kousathana Date: Fri, 3 Jan 2025 14:14:51 +0100 Subject: [PATCH] Fix yq test to not create empty commit --- .../pull_request/pull_request_test.go | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/internal/engine/actions/remediate/pull_request/pull_request_test.go b/internal/engine/actions/remediate/pull_request/pull_request_test.go index 5664c7cdaf..468bf1e2fc 100644 --- a/internal/engine/actions/remediate/pull_request/pull_request_test.go +++ b/internal/engine/actions/remediate/pull_request/pull_request_test.go @@ -9,6 +9,7 @@ import ( "context" "encoding/json" "fmt" + "google.golang.org/protobuf/types/known/structpb" "io" "net/http" "testing" @@ -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"), + }, + }), + }, + }, + }, + }, + }, + }, } }