Skip to content

Commit

Permalink
releaser: Try to fix the last failing step
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed May 31, 2024
1 parent 420f26b commit 74b9b8a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion releaser/releaser.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-present The Hugo Authors. All rights reserved.
// Copyright 2024 The Hugo Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -92,6 +92,8 @@ func (r *ReleaseHandler) Run() error {
mainVersion := newVersion
mainVersion.PatchLevel = 0

r.gitPull()

defer r.gitPush()

if r.step == 1 {
Expand Down Expand Up @@ -178,6 +180,12 @@ func (r ReleaseHandler) calculateVersions() (hugo.Version, hugo.Version) {
return newVersion, finalVersion
}

func (r *ReleaseHandler) gitPull() {
if _, err := r.git("pull", "origin", "HEAD"); err != nil {
log.Fatal("pull failed:", err)
}
}

func (r *ReleaseHandler) gitPush() {
if r.skipPush {
return
Expand Down

0 comments on commit 74b9b8a

Please sign in to comment.