diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-05-31 09:03:09 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-05-31 09:03:09 +0200 |
commit | 74b9b8a2297852f37be55d4e12acb79de492707b (patch) | |
tree | e5fc9b41ba8b68785e25aaacbc31442ad02cffe1 | |
parent | 420f26b6bb10cfe2e4a9cca0d300595ab7cada6e (diff) |
releaser: Try to fix the last failing step
-rw-r--r-- | releaser/releaser.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/releaser/releaser.go b/releaser/releaser.go index 254bda5b3..f2244842a 100644 --- a/releaser/releaser.go +++ b/releaser/releaser.go @@ -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. @@ -92,6 +92,8 @@ func (r *ReleaseHandler) Run() error { mainVersion := newVersion mainVersion.PatchLevel = 0 + r.gitPull() + defer r.gitPush() if r.step == 1 { @@ -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 |