@@ -6,6 +6,7 @@ import * as pep440 from '@renovate/pep440';
66import * as semver from 'semver' ;
77import { Inputs , tmpDir } from './context' ;
88import { ReposGetResponseData } from './github' ;
9+ import * as icl from './image' ;
910import * as tcl from './tag' ;
1011import * as fcl from './flavor' ;
1112import * as core from '@actions/core' ;
@@ -23,6 +24,7 @@ export class Meta {
2324 private readonly inputs : Inputs ;
2425 private readonly context : Context ;
2526 private readonly repo : ReposGetResponseData ;
27+ private readonly images : icl . Image [ ] ;
2628 private readonly tags : tcl . Tag [ ] ;
2729 private readonly flavor : fcl . Flavor ;
2830 private readonly date : Date ;
@@ -38,6 +40,7 @@ export class Meta {
3840 this . inputs = inputs ;
3941 this . context = context ;
4042 this . repo = repo ;
43+ this . images = icl . Transform ( inputs . images ) ;
4144 this . tags = tcl . Transform ( inputs . tags ) ;
4245 this . flavor = fcl . Transform ( inputs . flavor ) ;
4346 this . date = new Date ( ) ;
@@ -404,20 +407,29 @@ export class Meta {
404407 } ) ;
405408 }
406409
410+ private getImageNames ( ) : Array < string > {
411+ const images : Array < string > = [ ] ;
412+ for ( const image of this . images ) {
413+ if ( ! image . enable ) {
414+ continue ;
415+ }
416+ images . push ( image . name ) ;
417+ }
418+ return images ;
419+ }
420+
407421 public getTags ( ) : Array < string > {
408422 if ( ! this . version . main ) {
409423 return [ ] ;
410424 }
411-
412425 const tags : Array < string > = [ ] ;
413- for ( const image of this . inputs . images ) {
414- const imageLc = image . toLowerCase ( ) ;
415- tags . push ( `${ imageLc } :${ this . version . main } ` ) ;
426+ for ( const imageName of this . getImageNames ( ) ) {
427+ tags . push ( `${ imageName } :${ this . version . main } ` ) ;
416428 for ( const partial of this . version . partial ) {
417- tags . push ( `${ imageLc } :${ partial } ` ) ;
429+ tags . push ( `${ imageName } :${ partial } ` ) ;
418430 }
419431 if ( this . version . latest ) {
420- tags . push ( `${ imageLc } :${ this . flavor . prefixLatest ? this . flavor . prefix : '' } latest${ this . flavor . suffixLatest ? this . flavor . suffix : '' } ` ) ;
432+ tags . push ( `${ imageName } :${ this . flavor . prefixLatest ? this . flavor . prefix : '' } latest${ this . flavor . suffixLatest ? this . flavor . suffix : '' } ` ) ;
421433 }
422434 }
423435 return tags ;
@@ -470,7 +482,7 @@ export class Meta {
470482 return res ;
471483 } , { } ) ,
472484 args : {
473- DOCKER_META_IMAGES : this . inputs . images . join ( ',' ) ,
485+ DOCKER_META_IMAGES : this . getImageNames ( ) . join ( ',' ) ,
474486 DOCKER_META_VERSION : this . version . main
475487 }
476488 }
0 commit comments