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(
15
15
// main
16
16
async ( ) => {
17
17
const inputs : Inputs = getInputs ( ) ;
18
- if ( inputs . images . length == 0 ) {
19
- throw new Error ( `images input required` ) ;
20
- }
21
-
22
18
const toolkit = new Toolkit ( { githubToken : inputs . githubToken } ) ;
23
19
const context = await getContext ( inputs . context ) ;
24
20
const repo = await toolkit . github . repoData ( ) ;
Original file line number Diff line number Diff line change @@ -441,14 +441,27 @@ export class Meta {
441
441
return [ ] ;
442
442
}
443
443
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 ) ;
446
459
for ( const partial of this . version . partial ) {
447
- tags . push ( ` ${ imageName } : ${ partial } ` ) ;
460
+ tags . push ( partial ) ;
448
461
}
449
462
if ( this . version . latest ) {
450
463
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 ) ) ;
452
465
}
453
466
}
454
467
return tags ;
You can’t perform that action at this time.
0 commit comments