@@ -84,6 +84,12 @@ func ProcessMR(ctx context.Context, client scm.Client, cfg *config.Config, mr st
84
84
}
85
85
86
86
func updateMergeRequest (ctx context.Context , client scm.Client , update * scm.UpdateMergeRequestOptions ) error {
87
+ if state .IsDryRun (ctx ) {
88
+ slogctx .Info (ctx , "In dry-run, dumping the update struct we would send to GitLab" , slog .Any ("changes" , update ))
89
+
90
+ return nil
91
+ }
92
+
87
93
_ , err := client .MergeRequests ().Update (ctx , update )
88
94
89
95
return err
@@ -117,6 +123,10 @@ func syncLabels(ctx context.Context, client scm.Client, remote []*scm.Label, req
117
123
118
124
slogctx .Info (ctx , "Creating label" , slog .String ("label" , label .Name ))
119
125
126
+ if state .IsDryRun (ctx ) {
127
+ continue
128
+ }
129
+
120
130
_ , resp , err := client .Labels ().Create (ctx , & scm.CreateLabelOptions {
121
131
Name : & label .Name , //nolint:gosec
122
132
Color : & label .Color , //nolint:gosec
@@ -148,6 +158,10 @@ func syncLabels(ctx context.Context, client scm.Client, remote []*scm.Label, req
148
158
149
159
slogctx .Info (ctx , "Updating label" , slog .String ("label" , label .Name ))
150
160
161
+ if state .IsDryRun (ctx ) {
162
+ continue
163
+ }
164
+
151
165
_ , _ , err := client .Labels ().Update (ctx , & scm.UpdateLabelOptions {
152
166
Name : & label .Name , //nolint:gosec
153
167
Color : & label .Color , //nolint:gosec
0 commit comments