You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnfmt.Errorf("failed to parse LTS release date: %v", err)
290
+
}
291
+
iftime.Since(releaseDate) >6*30*24*time.Hour { // 6 months in hours
292
+
return&ValidationError{
293
+
Message: fmt.Sprintf("Your current Node.js version %s is no longer supported. Please upgrade to the latest Long Term Support version %s or later", currentMajorVersion, ltsVersion),
294
+
}
295
+
} else {
296
+
fmt.Printf("A new Node.js Long Term Support version is out, released on (%s). After 6 months of release, Your current Node.js version v%d will fail CI workflows if it is not upgraded to v%d.\n", ltsReleaseDate, currentMajorVersionInt, ltsMajorVersionInt)
returnfmt.Errorf("failed to fetch latest Go version: %v", err)
@@ -216,6 +350,31 @@ func validateRun() error {
216
350
// We'll give a PR comment to the Author to warn them about the need to upgrade
217
351
fmt.Printf("A new Go version is out, released on (%v). After 6 months of release, Your current Go version (%v) will fail CI workflows if it is not upgraded.\n", releaseDate, f.Go.Version)
218
352
}
353
+
354
+
returnnil
355
+
}
356
+
357
+
// validateRun checks the env.branch and go version to ensure the build is valid.
358
+
funcvalidateRun() error {
359
+
ifstrings.Contains(environment.Branch(), "/") {
360
+
return&ValidationError{Message: fmt.Sprintf("branch name %s contains a `/` character, which is not supported by catapult", environment.Branch())}
361
+
}
362
+
363
+
// if package.json exists, we will validate the Node.js version
364
+
if_, err:=os.Stat("./package.json"); err==nil {
365
+
err=validateNodeVersion()
366
+
iferr!=nil {
367
+
returnfmt.Errorf("failed to validate Node.js version: %v", err)
368
+
}
369
+
}
370
+
371
+
// if go.mod exists, we will validate the Go version
372
+
if_, err:=os.Stat("./go.mod"); err==nil {
373
+
err=validateGoVersion()
374
+
iferr!=nil {
375
+
returnfmt.Errorf("failed to validate Go version: %v", err)
0 commit comments