fix: skip git commit if no changes in upgrade
Some checks failed
Build & Release / build (push) Has been cancelled
Some checks failed
Build & Release / build (push) Has been cancelled
This commit is contained in:
@@ -62,6 +62,8 @@ export async function upgradeCustomerChart(slug: string, version: string) {
|
|||||||
const manifest = buildArgoCDApp(slug, version);
|
const manifest = buildArgoCDApp(slug, version);
|
||||||
writeFileSync(join(dir, "customers", `${slug}.yaml`), manifest);
|
writeFileSync(join(dir, "customers", `${slug}.yaml`), manifest);
|
||||||
execSync(`git -C ${dir} add customers/${slug}.yaml`, { env });
|
execSync(`git -C ${dir} add customers/${slug}.yaml`, { env });
|
||||||
|
const diff = execSync(`git -C ${dir} diff --cached --name-only`, { env }).toString().trim();
|
||||||
|
if (!diff) return;
|
||||||
execSync(`git -C ${dir} commit -m "chore: upgrade customer ${slug} to chart ${version}"`, { env });
|
execSync(`git -C ${dir} commit -m "chore: upgrade customer ${slug} to chart ${version}"`, { env });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -73,6 +75,8 @@ export async function upgradeAllCustomerCharts(slugs: string[], version: string)
|
|||||||
writeFileSync(join(dir, "customers", `${slug}.yaml`), manifest);
|
writeFileSync(join(dir, "customers", `${slug}.yaml`), manifest);
|
||||||
execSync(`git -C ${dir} add customers/${slug}.yaml`, { env });
|
execSync(`git -C ${dir} add customers/${slug}.yaml`, { env });
|
||||||
}
|
}
|
||||||
|
const diff = execSync(`git -C ${dir} diff --cached --name-only`, { env }).toString().trim();
|
||||||
|
if (!diff) return;
|
||||||
execSync(`git -C ${dir} commit -m "chore: upgrade all customers to chart ${version}"`, { env });
|
execSync(`git -C ${dir} commit -m "chore: upgrade all customers to chart ${version}"`, { env });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user