Ignore comma sep for CSV inputs type

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-08-29 17:15:26 +02:00
parent c124ff0226
commit 8954ded19b
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
4 changed files with 42 additions and 14 deletions

12
dist/index.js generated vendored
View file

@ -3566,9 +3566,9 @@ function getInputs() {
platforms: yield getInputList('platforms'),
load: /true/i.test(core.getInput('load')),
push: /true/i.test(core.getInput('push')),
outputs: yield getInputList('outputs'),
cacheFrom: yield getInputList('cache-from'),
cacheTo: yield getInputList('cache-to')
outputs: yield getInputList('outputs', true),
cacheFrom: yield getInputList('cache-from', true),
cacheTo: yield getInputList('cache-to', true)
};
});
}
@ -3640,13 +3640,15 @@ function getCommonArgs(inputs) {
return args;
});
}
function getInputList(name) {
function getInputList(name, ignoreComma) {
return __awaiter(this, void 0, void 0, function* () {
const items = core.getInput(name);
if (items == '') {
return [];
}
return items.split(/\r?\n/).reduce((acc, line) => acc.concat(line.split(',')).map(pat => pat.trim()), []);
return items
.split(/\r?\n/)
.reduce((acc, line) => acc.concat(!ignoreComma ? line.split(',') : line).map(pat => pat.trim()), []);
});
}
exports.getInputList = getInputList;