fix: release check #44
|  | @ -39,7 +39,7 @@ var Version string | |||
| 
 | ||||
| // Generally, err is used for runtime errors, and checkRes is used for the result of the checks.
 | ||||
| func main() { | ||||
| 	var gitWhitelist, metaFile, releaseTags []string | ||||
| 	var gitWhitelist, metaFile []string | ||||
| 	showVersion := flag.Bool("version", false, "print current version") | ||||
| 	rootDir := flag.String("root", "", "") | ||||
| 	repo := flag.String("repo", "", "") | ||||
|  | @ -51,7 +51,6 @@ func main() { | |||
| 	checkFileSumList := flag.String("checkFileSumList", "", "Comma-separated list of expected checksums.") | ||||
| 	parseMultiValueFlag(&gitWhitelist, "whitelist", "") | ||||
| 	parseMultiValueFlag(&metaFile, "meta", "") | ||||
| 	parseMultiValueFlag(&releaseTags, "releaseTags", "") | ||||
| 	flag.Parse() | ||||
| 	if *showVersion { | ||||
| 		fmt.Println(Version) | ||||
|  | @ -83,7 +82,6 @@ func main() { | |||
| 	if err != nil { | ||||
| 		fmt.Printf("## Release Tag Check Failed:\n%s\n", err.Error()) | ||||
| 	} | ||||
| 	// FIXME: for drone usage
 | ||||
| 	err = healthcheck.VerifyFiles(*rootDir, *checkFileNameList, *checkFileSumList) | ||||
| 	if err != nil { | ||||
| 		fmt.Printf("## Repo File Check Failed:\n%s\n", err.Error()) | ||||
|  |  | |||
|  | @ -32,6 +32,10 @@ func getTagsFromRepo(repoPath string) ([]string, error) { | |||
| } | ||||
| 
 | ||||
| func CheckTags(repoPath string, category string, n int) error { | ||||
| 	// INFO: if category not specified, skipping this check by default
 | ||||
| 	if category == "" { | ||||
| 		return nil | ||||
| 	} | ||||
| 	tags, err := getTagsFromRepo(repoPath) | ||||
| 	if err != nil { | ||||
| 		return fmt.Errorf("error getting tags: %v", err) | ||||
|  | @ -56,7 +60,7 @@ func CheckTags(repoPath string, category string, n int) error { | |||
| 		} | ||||
| 	} | ||||
| 	if !found { | ||||
| 		return fmt.Errorf("Wrong release tag '%s' or missing release tags. Please use one of '%s'.", target, strings.Join(tags, "', '")) | ||||
| 		return fmt.Errorf("Wrong release tag '%s' or missing release tags. Please use one of '%s'.", strings.Join(tags, "', '"), target) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user