@@ -837,24 +837,29 @@ describe('tag', () => {
837837 {
838838 images : [ 'org/app' , 'ghcr.io/user/app' ] ,
839839 tags : [
840- `type=match,"pattern=/^v(\\d.\\d.\\d)$/ig",group=1` ,
840+ `type=match,"pattern=v(.*)-beta.(.*)",group=1` ,
841+ `type=match,"pattern=v(.*)-beta.(.*)",group=2` ,
841842 ]
842843 } as Inputs ,
843844 {
844- main : 'v2 .0.8-beta.67 ' ,
845- partial : [ ] ,
846- latest : false
845+ main : '2 .0.8' ,
846+ partial : [ '67' ] ,
847+ latest : true
847848 } as Version ,
848849 [
849- 'org/app:v2.0.8-beta.67' ,
850- 'ghcr.io/user/app:v2.0.8-beta.67'
850+ 'org/app:2.0.8' ,
851+ 'org/app:67' ,
852+ 'org/app:latest' ,
853+ 'ghcr.io/user/app:2.0.8' ,
854+ 'ghcr.io/user/app:67' ,
855+ 'ghcr.io/user/app:latest'
851856 ] ,
852857 [
853858 "org.opencontainers.image.title=Hello-World" ,
854859 "org.opencontainers.image.description=This your first repo!" ,
855860 "org.opencontainers.image.url=https://github.com/octocat/Hello-World" ,
856861 "org.opencontainers.image.source=https://github.com/octocat/Hello-World" ,
857- "org.opencontainers.image.version=v2 .0.8-beta.67 " ,
862+ "org.opencontainers.image.version=2 .0.8" ,
858863 "org.opencontainers.image.created=2020-01-10T00:30:00.000Z" ,
859864 "org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071" ,
860865 "org.opencontainers.image.licenses=MIT"
@@ -870,20 +875,17 @@ describe('tag', () => {
870875 ]
871876 } as Inputs ,
872877 {
873- main : 'sometag' ,
878+ main : undefined ,
874879 partial : [ ] ,
875880 latest : false
876881 } as Version ,
877- [
878- 'org/app:sometag' ,
879- 'ghcr.io/user/app:sometag'
880- ] ,
882+ [ ] ,
881883 [
882884 "org.opencontainers.image.title=Hello-World" ,
883885 "org.opencontainers.image.description=This your first repo!" ,
884886 "org.opencontainers.image.url=https://github.com/octocat/Hello-World" ,
885887 "org.opencontainers.image.source=https://github.com/octocat/Hello-World" ,
886- "org.opencontainers.image.version=sometag " ,
888+ "org.opencontainers.image.version=" ,
887889 "org.opencontainers.image.created=2020-01-10T00:30:00.000Z" ,
888890 "org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071" ,
889891 "org.opencontainers.image.licenses=MIT"
@@ -1089,6 +1091,84 @@ describe('tag', () => {
10891091 "org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071" ,
10901092 "org.opencontainers.image.licenses=MIT"
10911093 ]
1094+ ] ,
1095+ [
1096+ 'tag17' ,
1097+ 'event_tag_p1-v1.0.0.env' ,
1098+ {
1099+ images : [ 'org/app' , 'ghcr.io/user/app' ] ,
1100+ tags : [
1101+ `type=match,"pattern=/^v(\\d.\\d.\\d)$/ig",group=1` ,
1102+ `type=match,pattern=\\d.\\d.\\d` ,
1103+ `type=match,pattern=\\d.\\d` ,
1104+ `type=ref,event=pr` ,
1105+ `type=sha`
1106+ ]
1107+ } as Inputs ,
1108+ {
1109+ main : '1.0.0' ,
1110+ partial : [ '1.0' , 'sha-90dd603' ] ,
1111+ latest : true
1112+ } as Version ,
1113+ [
1114+ 'org/app:1.0.0' ,
1115+ 'org/app:1.0' ,
1116+ 'org/app:sha-90dd603' ,
1117+ 'org/app:latest' ,
1118+ 'ghcr.io/user/app:1.0.0' ,
1119+ 'ghcr.io/user/app:1.0' ,
1120+ 'ghcr.io/user/app:sha-90dd603' ,
1121+ 'ghcr.io/user/app:latest'
1122+ ] ,
1123+ [
1124+ "org.opencontainers.image.title=Hello-World" ,
1125+ "org.opencontainers.image.description=This your first repo!" ,
1126+ "org.opencontainers.image.url=https://github.com/octocat/Hello-World" ,
1127+ "org.opencontainers.image.source=https://github.com/octocat/Hello-World" ,
1128+ "org.opencontainers.image.version=1.0.0" ,
1129+ "org.opencontainers.image.created=2020-01-10T00:30:00.000Z" ,
1130+ "org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071" ,
1131+ "org.opencontainers.image.licenses=MIT"
1132+ ]
1133+ ] ,
1134+ [
1135+ 'tag18' ,
1136+ 'event_tag_p1-v1.0.0.env' ,
1137+ {
1138+ images : [ 'org/app' , 'ghcr.io/user/app' ] ,
1139+ tags : [
1140+ `type=match,pattern=p1-v(\\d.\\d.\\d),group=1` ,
1141+ `type=match,pattern=p1-v(\\d.\\d),group=1` ,
1142+ `type=match,pattern=p1-v(\\d.\\d),group=3` ,
1143+ `type=ref,event=pr` ,
1144+ `type=sha`
1145+ ]
1146+ } as Inputs ,
1147+ {
1148+ main : '1.0.0' ,
1149+ partial : [ '1.0' , 'sha-90dd603' ] ,
1150+ latest : true
1151+ } as Version ,
1152+ [
1153+ 'org/app:1.0.0' ,
1154+ 'org/app:1.0' ,
1155+ 'org/app:sha-90dd603' ,
1156+ 'org/app:latest' ,
1157+ 'ghcr.io/user/app:1.0.0' ,
1158+ 'ghcr.io/user/app:1.0' ,
1159+ 'ghcr.io/user/app:sha-90dd603' ,
1160+ 'ghcr.io/user/app:latest'
1161+ ] ,
1162+ [
1163+ "org.opencontainers.image.title=Hello-World" ,
1164+ "org.opencontainers.image.description=This your first repo!" ,
1165+ "org.opencontainers.image.url=https://github.com/octocat/Hello-World" ,
1166+ "org.opencontainers.image.source=https://github.com/octocat/Hello-World" ,
1167+ "org.opencontainers.image.version=1.0.0" ,
1168+ "org.opencontainers.image.created=2020-01-10T00:30:00.000Z" ,
1169+ "org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071" ,
1170+ "org.opencontainers.image.licenses=MIT"
1171+ ]
10921172 ]
10931173 ] ) ( 'given %p with %p event' , tagsLabelsTest ) ;
10941174} ) ;
0 commit comments