mirror of
https://code.forgejo.org/docker/metadata-action.git
synced 2025-09-16 09:46:56 +00:00
Trim tags and flavor inputs
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
110426b173
commit
b69dce7fed
4 changed files with 55 additions and 26 deletions
11
src/tag.ts
11
src/tag.ts
|
@ -93,12 +93,15 @@ export function Parse(s: string): Tag {
|
|||
|
||||
const tag = new Tag();
|
||||
for (const field of fields) {
|
||||
const parts = field.toString().split('=', 2);
|
||||
const parts = field
|
||||
.toString()
|
||||
.split('=')
|
||||
.map(item => item.trim());
|
||||
if (parts.length == 1) {
|
||||
tag.attrs['value'] = parts[0].trim();
|
||||
tag.attrs['value'] = parts[0];
|
||||
} else {
|
||||
const key = parts[0].trim().toLowerCase();
|
||||
const value = parts[1].trim();
|
||||
const key = parts[0].toLowerCase();
|
||||
const value = parts[1];
|
||||
switch (key) {
|
||||
case 'type': {
|
||||
if (!Object.values(Type).includes(value)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue