Skip to content

Commit 1694177

Browse files
scripts/bumper: only marshal missing commits
Signed-off-by: Steve Kuznetsov <[email protected]>
1 parent cc39d2c commit 1694177

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

scripts/bumper/main.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,6 @@ func main() {
173173
}
174174
}
175175

176-
if opts.commitFileOutput != "" {
177-
commitsJson, err := json.Marshal(commits)
178-
if err != nil {
179-
logrus.WithError(err).Fatal("could not marshal commits")
180-
}
181-
if err := os.WriteFile(opts.commitFileOutput, commitsJson, 0666); err != nil {
182-
logrus.WithError(err).Fatal("could not write commits")
183-
}
184-
}
185-
186176
var missingCommits []commit
187177
for _, commit := range commits {
188178
commitLogger := logger.WithField("commit", commit.Hash)
@@ -195,6 +185,16 @@ func main() {
195185
}
196186
}
197187

188+
if opts.commitFileOutput != "" {
189+
commitsJson, err := json.Marshal(missingCommits)
190+
if err != nil {
191+
logrus.WithError(err).Fatal("could not marshal commits")
192+
}
193+
if err := os.WriteFile(opts.commitFileOutput, commitsJson, 0666); err != nil {
194+
logrus.WithError(err).Fatal("could not write commits")
195+
}
196+
}
197+
198198
cherryPickAll := func() {
199199
if err := setCommitter(ctx, logger.WithField("phase", "setup"), opts.gitName, opts.gitEmail); err != nil {
200200
logger.WithError(err).Fatal("failed to set committer")

0 commit comments

Comments
 (0)