[Release] 22.3.0 (#2842)

* [Release] 22.3.0

* Update version.h

* Redirect stderr

* Update should-release to filter non-master

* Update should-release
This commit is contained in:
Chris Miles
2023-02-06 20:12:04 -06:00
committed by GitHub
parent fb1467284c
commit 158396937a
9 changed files with 109 additions and 7 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
module should-release
go 1.19
go 1.18
require (
github.com/google/go-github/v41 v41.0.0
@@ -10,6 +10,7 @@ import (
"log"
"net/http"
"os"
"os/exec"
"path/filepath"
"strings"
)
@@ -59,6 +60,29 @@ func main() {
}
}
out, err := exec.Command("git", "rev-parse", "--abbrev-ref", "HEAD").Output()
if err != nil {
log.Fatal(err)
}
currentBranch := strings.TrimSpace(string(out))
if currentBranch != "master" {
fmt.Printf("Not on master, no need to release\n")
fmt.Printf("Exiting code 78 to halt pipeline steps gracefully\n")
os.Exit(78)
}
if len(os.Getenv("RCLONE_FTP_PASS")) == 0 {
fmt.Printf("Missing RCLONE_FTP_PASS no need to deploy\n")
fmt.Printf("Exiting code 78 to halt pipeline steps gracefully\n")
os.Exit(78)
}
if len(os.Getenv("GH_RELEASE_GITHUB_API_TOKEN")) == 0 {
fmt.Printf("Missing GH_RELEASE_GITHUB_API_TOKEN no need to deploy\n")
fmt.Printf("Exiting code 78 to halt pipeline steps gracefully\n")
os.Exit(78)
}
if len(packageJsonFile) == 0 {
fmt.Printf("Could not find package.json\n")
os.Exit(1)
Binary file not shown.