ci(release): handle no folder gracefully (#27)
This commit is contained in:
parent
66adc32ff7
commit
bf4743acac
2 changed files with 18 additions and 0 deletions
|
@ -15,6 +15,11 @@ export async function main(rawArgs: string[]) {
|
|||
const args = rawArgs.slice(2);
|
||||
const archives = await getChangedChartsArchives(args);
|
||||
|
||||
if (archives.length === 0) {
|
||||
console.log("No charts to push");
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("Pushing charts");
|
||||
for (const archive of archives) {
|
||||
const cmd = `helm push "${archive.path}" "oci://ghcr.io/${process.env.GITHUB_REPOSITORY}"`;
|
||||
|
@ -45,6 +50,13 @@ export async function getChangedChartsArchives(
|
|||
}
|
||||
|
||||
async function getChartArchives(): Promise<Record<string, Archive>> {
|
||||
try {
|
||||
await fs.access(CR_RELEASE_PACKAGE_PATH);
|
||||
} catch (e) {
|
||||
console.log("No chart archives found");
|
||||
return {};
|
||||
}
|
||||
|
||||
const archiveList = await fs.readdir(CR_RELEASE_PACKAGE_PATH, {
|
||||
withFileTypes: true,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue