ci: fix artifact name generation in cloud cleaner

The issue comes from the fact that the PR introducing it was very old
and meanwhile the variable used for image name creation has changed.
This patch makes sure both functions are the same.
This commit is contained in:
Martin Sehnoutka 2020-10-14 10:38:35 +02:00 committed by Ondřej Budai
parent f52ff68798
commit 174e3f2037
2 changed files with 7 additions and 7 deletions

View file

@ -53,13 +53,13 @@ var failLocalBoot = flag.Bool("fail-local-boot", true, "when this flag is on (de
// note: in case of migration to sth else like Github Actions, change it to whatever variables GH Action provides
func GenerateCIArtifactName(prefix string) (string, error) {
distroCode := os.Getenv("DISTRO_CODE")
changeId := os.Getenv("BRANCH_NAME")
branchName := os.Getenv("BRANCH_NAME")
buildId := os.Getenv("BUILD_ID")
if changeId == "" || buildId == "" || distroCode == "" {
if branchName == "" || buildId == "" || distroCode == "" {
return "", fmt.Errorf("The environment variables must specify BRANCH_NAME, BUILD_ID, and DISTRO_CODE")
}
return fmt.Sprintf("%s%s-%s-%s", prefix, distroCode, changeId, buildId), nil
return fmt.Sprintf("%s%s-%s-%s", prefix, distroCode, branchName, buildId), nil
}
// runOsbuild runs osbuild with the specified manifest and output-directory.