bake: split definition into two files

Allows to either include tags or labels or both definitions.
Keep bake-file output for backward compatibility.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-11-22 22:46:29 +01:00
parent 62339db73c
commit b94479639a
6 changed files with 443 additions and 281 deletions

View File

@@ -81,11 +81,16 @@ actionsToolkit.run(
setOutput('json', JSON.stringify(jsonOutput));
});
// Bake file definition
const bakeFile: string = meta.getBakeFile();
await core.group(`Bake file definition`, async () => {
core.info(fs.readFileSync(bakeFile, 'utf8'));
setOutput('bake-file', bakeFile);
});
// Bake files
for (const kind of ['tags', 'labels']) {
const bakeFile: string = meta.getBakeFile(kind);
await core.group(`Bake file definition (${kind})`, async () => {
core.info(fs.readFileSync(bakeFile, 'utf8'));
setOutput(`bake-file-${kind}`, bakeFile);
});
}
// Bake file with tags and labels
setOutput(`bake-file`, meta.getBakeFileTagsLabels());
}
);