@@ -837,24 +837,29 @@ describe('tag', () => {
837
837
{
838
838
images : [ 'org/app' , 'ghcr.io/user/app' ] ,
839
839
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` ,
841
842
]
842
843
} as Inputs ,
843
844
{
844
- main : 'v2 .0.8-beta.67 ' ,
845
- partial : [ ] ,
846
- latest : false
845
+ main : '2 .0.8' ,
846
+ partial : [ '67' ] ,
847
+ latest : true
847
848
} as Version ,
848
849
[
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'
851
856
] ,
852
857
[
853
858
"org.opencontainers.image.title=Hello-World" ,
854
859
"org.opencontainers.image.description=This your first repo!" ,
855
860
"org.opencontainers.image.url=https://github.com/octocat/Hello-World" ,
856
861
"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" ,
858
863
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z" ,
859
864
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071" ,
860
865
"org.opencontainers.image.licenses=MIT"
@@ -870,20 +875,17 @@ describe('tag', () => {
870
875
]
871
876
} as Inputs ,
872
877
{
873
- main : 'sometag' ,
878
+ main : undefined ,
874
879
partial : [ ] ,
875
880
latest : false
876
881
} as Version ,
877
- [
878
- 'org/app:sometag' ,
879
- 'ghcr.io/user/app:sometag'
880
- ] ,
882
+ [ ] ,
881
883
[
882
884
"org.opencontainers.image.title=Hello-World" ,
883
885
"org.opencontainers.image.description=This your first repo!" ,
884
886
"org.opencontainers.image.url=https://github.com/octocat/Hello-World" ,
885
887
"org.opencontainers.image.source=https://github.com/octocat/Hello-World" ,
886
- "org.opencontainers.image.version=sometag " ,
888
+ "org.opencontainers.image.version=" ,
887
889
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z" ,
888
890
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071" ,
889
891
"org.opencontainers.image.licenses=MIT"
@@ -1089,6 +1091,82 @@ describe('tag', () => {
1089
1091
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071" ,
1090
1092
"org.opencontainers.image.licenses=MIT"
1091
1093
]
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=\\d.\\d.\\d` ,
1102
+ `type=match,pattern=\\d.\\d` ,
1103
+ `type=ref,event=pr` ,
1104
+ `type=sha`
1105
+ ]
1106
+ } as Inputs ,
1107
+ {
1108
+ main : '1.0.0' ,
1109
+ partial : [ '1.0' , 'sha-90dd603' ] ,
1110
+ latest : true
1111
+ } as Version ,
1112
+ [
1113
+ 'org/app:1.0.0' ,
1114
+ 'org/app:1.0' ,
1115
+ 'org/app:sha-90dd603' ,
1116
+ 'org/app:latest' ,
1117
+ 'ghcr.io/user/app:1.0.0' ,
1118
+ 'ghcr.io/user/app:1.0' ,
1119
+ 'ghcr.io/user/app:sha-90dd603' ,
1120
+ 'ghcr.io/user/app:latest'
1121
+ ] ,
1122
+ [
1123
+ "org.opencontainers.image.title=Hello-World" ,
1124
+ "org.opencontainers.image.description=This your first repo!" ,
1125
+ "org.opencontainers.image.url=https://github.com/octocat/Hello-World" ,
1126
+ "org.opencontainers.image.source=https://github.com/octocat/Hello-World" ,
1127
+ "org.opencontainers.image.version=1.0.0" ,
1128
+ "org.opencontainers.image.created=2020-01-10T00:30:00.000Z" ,
1129
+ "org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071" ,
1130
+ "org.opencontainers.image.licenses=MIT"
1131
+ ]
1132
+ ] ,
1133
+ [
1134
+ 'tag18' ,
1135
+ 'event_tag_p1-v1.0.0.env' ,
1136
+ {
1137
+ images : [ 'org/app' , 'ghcr.io/user/app' ] ,
1138
+ tags : [
1139
+ `type=match,pattern=p1-v(\\d.\\d.\\d),group=1` ,
1140
+ `type=match,pattern=p1-v(\\d.\\d),group=1` ,
1141
+ `type=ref,event=pr` ,
1142
+ `type=sha`
1143
+ ]
1144
+ } as Inputs ,
1145
+ {
1146
+ main : '1.0.0' ,
1147
+ partial : [ '1.0' , 'sha-90dd603' ] ,
1148
+ latest : true
1149
+ } as Version ,
1150
+ [
1151
+ 'org/app:1.0.0' ,
1152
+ 'org/app:1.0' ,
1153
+ 'org/app:sha-90dd603' ,
1154
+ 'org/app:latest' ,
1155
+ 'ghcr.io/user/app:1.0.0' ,
1156
+ 'ghcr.io/user/app:1.0' ,
1157
+ 'ghcr.io/user/app:sha-90dd603' ,
1158
+ 'ghcr.io/user/app:latest'
1159
+ ] ,
1160
+ [
1161
+ "org.opencontainers.image.title=Hello-World" ,
1162
+ "org.opencontainers.image.description=This your first repo!" ,
1163
+ "org.opencontainers.image.url=https://github.com/octocat/Hello-World" ,
1164
+ "org.opencontainers.image.source=https://github.com/octocat/Hello-World" ,
1165
+ "org.opencontainers.image.version=1.0.0" ,
1166
+ "org.opencontainers.image.created=2020-01-10T00:30:00.000Z" ,
1167
+ "org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071" ,
1168
+ "org.opencontainers.image.licenses=MIT"
1169
+ ]
1092
1170
]
1093
1171
] ) ( 'given %p with %p event' , tagsLabelsTest ) ;
1094
1172
} ) ;
0 commit comments