mirror of
https://github.com/docker/metadata-action.git
synced 2026-07-04 08:59:31 +00:00
report invalid global expressions clearly
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
530a407188
commit
7282ab7c69
2 changed files with 35 additions and 2 deletions
|
|
@ -76,6 +76,27 @@ describe('isRawStatement', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('global expressions', () => {
|
||||
test('throws for unknown global expression', async () => {
|
||||
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', 'event_push_master.env')));
|
||||
const toolkit = new Toolkit();
|
||||
const repo = await toolkit.github.repoData();
|
||||
const context = await getContext(ContextSource.workflow, toolkit);
|
||||
|
||||
expect(() => {
|
||||
new Meta(
|
||||
{
|
||||
...getInputs(),
|
||||
images: ['user/app'],
|
||||
tags: [`type=raw,value=latest,enable={{is_prerelease}}`]
|
||||
},
|
||||
context,
|
||||
repo
|
||||
);
|
||||
}).toThrow('{{is_prerelease}} is not a valid global expression');
|
||||
});
|
||||
});
|
||||
|
||||
const tagsLabelsTest = async (name: string, envFile: string, inputs: Inputs, exVersion: Version, exTags: Array<string>, exLabels: Array<string>, exAnnotations: Array<string> | undefined) => {
|
||||
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
|
||||
const toolkit = new Toolkit();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue