File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,6 @@ actionsToolkit.run(
1515 // main
1616 async ( ) => {
1717 const inputs : Inputs = getInputs ( ) ;
18- if ( inputs . images . length == 0 ) {
19- throw new Error ( `images input required` ) ;
20- }
21-
2218 const toolkit = new Toolkit ( { githubToken : inputs . githubToken } ) ;
2319 const context = await getContext ( inputs . context ) ;
2420 const repo = await toolkit . github . repoData ( ) ;
Original file line number Diff line number Diff line change @@ -441,14 +441,27 @@ export class Meta {
441441 return [ ] ;
442442 }
443443 const tags : Array < string > = [ ] ;
444- for ( const imageName of this . getImageNames ( ) ) {
445- tags . push ( `${ imageName } :${ this . version . main } ` ) ;
444+ const images = this . getImageNames ( ) ;
445+ if ( Array . isArray ( images ) && images . length ) {
446+ for ( const imageName of images ) {
447+ tags . push ( `${ imageName } :${ this . version . main } ` ) ;
448+ for ( const partial of this . version . partial ) {
449+ tags . push ( `${ imageName } :${ partial } ` ) ;
450+ }
451+ if ( this . version . latest ) {
452+ const latestTag = `${ this . flavor . prefixLatest ? this . flavor . prefix : '' } latest${ this . flavor . suffixLatest ? this . flavor . suffix : '' } ` ;
453+ tags . push ( `${ imageName } :${ Meta . sanitizeTag ( latestTag ) } ` ) ;
454+ }
455+ }
456+ }
457+ else {
458+ tags . push ( this . version . main ) ;
446459 for ( const partial of this . version . partial ) {
447- tags . push ( ` ${ imageName } : ${ partial } ` ) ;
460+ tags . push ( partial ) ;
448461 }
449462 if ( this . version . latest ) {
450463 const latestTag = `${ this . flavor . prefixLatest ? this . flavor . prefix : '' } latest${ this . flavor . suffixLatest ? this . flavor . suffix : '' } ` ;
451- tags . push ( ` ${ imageName } : ${ Meta . sanitizeTag ( latestTag ) } ` ) ;
464+ tags . push ( Meta . sanitizeTag ( latestTag ) ) ;
452465 }
453466 }
454467 return tags ;
You can’t perform that action at this time.
0 commit comments