Compare commits

..
9 Commits
Author SHA1 Message Date
CrazyMax 69f6fc9d46 Merge pull request #203 from crazy-max/san-fix
Sanitize tag earlier
2022-05-05 13:57:05 +02:00
CrazyMax 2f5b5ae8bf Sanitize tag earlier
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-05 13:54:54 +02:00
CrazyMax f206c36955 Merge pull request #202 from crazy-max/v4-prep
readme: set metadata-action to v4
2022-05-05 11:43:25 +02:00
CrazyMax a20adfa74e readme: set metadata-action to v4
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-05 11:41:40 +02:00
CrazyMax 26b9439ce3 Merge pull request #201 from crazy-max/fix-sanitization
Do not sanitize before pattern matching
2022-05-05 11:33:19 +02:00
CrazyMax 467883f452 Merge pull request #176 from crazy-max/node-16
Node 16 as default runtime
2022-05-05 11:32:46 +02:00
CrazyMax 5edf56f2c4 Node 16 as default runtime
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-04 15:14:01 +02:00
CrazyMax 678218f2be Note about image name and tag sanitization
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-04 15:02:47 +02:00
CrazyMax e44c1fbe6e Do not sanitize before pattern matching
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-04 15:02:20 +02:00
10 changed files with 65 additions and 38 deletions

No files matched your search

+29 -12
View File
@@ -31,6 +31,7 @@ ___
* [`type=raw`](#typeraw)
* [`type=sha`](#typesha)
* [Notes](#notes)
* [Image name and tag sanitization](#image-name-and-tag-sanitization)
* [Latest tag](#latest-tag)
* [Global expressions](#global-expressions)
* [`{{branch}}`](#branch)
@@ -71,7 +72,7 @@ jobs:
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: name/app
-
@@ -124,7 +125,7 @@ jobs:
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: |
name/app
@@ -202,7 +203,7 @@ jobs:
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: |
name/app
@@ -508,13 +509,13 @@ Can create a regular expression for matching Git tag with a pattern and capturin
[push tag event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push) but, you can also use
a custom value through `value` attribute.
| Git tag | Pattern | Group | Output |
|-------------------------|-------------------------------|---------|------------------------|
| `v1.2.3` | `\d.\d.\d` | `0` | `1.2.3` |
| `v2.0.8-beta.67` | `v(.*)` | `1` | `2.0.8-beta.67` |
| `v2.0.8-beta.67` | `v(\d.\d)` | `1` | `2.0` |
| `20200110-RC2` | `\d+` | `0` | `20200110` |
| `p1/v1.2.3` | `p1-v(\d.\d.\d)` | `1` | `1.2.3` |
| Git tag | Pattern | Group | Output |
|-------------------------|------------------|---------|------------------------|
| `v1.2.3` | `\d.\d.\d` | `0` | `1.2.3` |
| `v2.0.8-beta.67` | `v(.*)` | `1` | `2.0.8-beta.67` |
| `v2.0.8-beta.67` | `v(\d.\d)` | `1` | `2.0` |
| `20200110-RC2` | `\d+` | `0` | `20200110` |
| `p1/v1.2.3` | `p1/v(\d.\d.\d)` | `1` | `1.2.3` |
Extended attributes and default values:
@@ -625,6 +626,22 @@ tags: |
## Notes
### Image name and tag sanitization
In order to comply with [the specification](https://docs.docker.com/engine/reference/commandline/tag/#extended-description),
the image name components may contain lowercase letters, digits and separators.
A separator is defined as a period, one or two underscores, or one or more
dashes. A name component may not start or end with a separator.
A tag name must be a valid ASCII chars sequences and may contain lowercase and
uppercase letters, digits, underscores, periods and dashes. A tag name may not
start with a period or a dash and may contain a maximum of 128 characters.
To ease the integration in your workflow, this action will automatically:
* Lowercase the image name
* Replace invalid chars sequences with `-` for tags
### Latest tag
`latest` tag is handled through the [`flavor` input](#flavor-input). It will be generated by default (`auto` mode) for:
@@ -750,7 +767,7 @@ workflow using the [`fromJSON` function](https://docs.github.com/en/actions/lear
```yaml
-
name: Docker meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
id: meta
with:
images: name/app
@@ -775,7 +792,7 @@ labels generated are not suitable, you can overwrite them like this:
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: name/app
labels: |
+3 -3
View File
@@ -2,7 +2,7 @@
## v2 to v3
* Repository has been moved to docker org. Replace `crazy-max/ghaction-docker-meta@v2` with `docker/metadata-action@v3`
* Repository has been moved to docker org. Replace `crazy-max/ghaction-docker-meta@v2` with `docker/metadata-action@v4`
* The default bake target has been changed: `ghaction-docker-meta` > `docker-metadata-action`
## v1 to v2
@@ -180,7 +180,7 @@ jobs:
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: name/app
-
@@ -273,7 +273,7 @@ jobs:
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: name/app
tags: |
+2 -2
View File
@@ -53,7 +53,7 @@ describe('transform', () => {
[
`name=name/bar`,
`name/foo,enable=false`,
`name=ghcr.io/name/foo,enable=true`
`name=ghcr.io/UserName/Foo,enable=true`
],
[
{
@@ -65,7 +65,7 @@ describe('transform', () => {
enable: false,
},
{
name: `ghcr.io/name/foo`,
name: `ghcr.io/UserName/Foo`,
enable: true,
},
] as Image[],
+5 -5
View File
@@ -1277,9 +1277,9 @@ describe('tag', () => {
{
images: ['org/app', 'ghcr.io/user/app'],
tags: [
`type=match,pattern=p1-v(\\d.\\d.\\d),group=1`,
`type=match,pattern=p1-v(\\d.\\d),group=1`,
`type=match,pattern=p1-v(\\d.\\d),group=3`,
`type=match,pattern=p1/v(\\d.\\d.\\d),group=1`,
`type=match,pattern=p1/v(\\d.\\d),group=1`,
`type=match,pattern=p1/v(\\d.\\d),group=3`,
`type=ref,event=pr`,
`type=sha`
]
@@ -1316,8 +1316,8 @@ describe('tag', () => {
{
images: ['org/app', 'ghcr.io/user/app'],
tags: [
`type=match,pattern=p1-v(\\d.\\d.\\d),group=1`,
`type=match,pattern=p1-v(\\d.\\d),group=1,suffix=`,
`type=match,pattern=p1/v(\\d.\\d.\\d),group=1`,
`type=match,pattern=p1/v(\\d.\\d),group=1,suffix=`,
`type=ref,event=pr`,
`type=sha`
],
+1 -1
View File
@@ -46,5 +46,5 @@ outputs:
description: 'JSON output of tags and labels'
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'
+1 -1
View File
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG NODE_VERSION=12
ARG NODE_VERSION=16
FROM node:${NODE_VERSION}-alpine AS base
RUN apk add --no-cache cpio findutils git
Generated Vendored
+1 -1
View File
@@ -56,5 +56,5 @@ hooks.version="2.29.3";setHookCallback(createLocal);hooks.fn=We;hooks.min=min;ho
* XRegExp 4.4.1
* <xregexp.com>
* Steven Levithan (c) 2007-present MIT License
*/var T="xregexp";var k={astral:false,namespacing:false};var O={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split};var P={};var x={};var A={};var D=[];var N="default";var C="class";var I={default:/\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/,class:/\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/};var R=/\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g;var L=O.exec.call(/()??/,"")[1]===undefined;var M=(0,E["default"])(/x/)!==undefined;var G={},V=G.toString;function hasNativeFlag(t){var a=true;try{new RegExp("",t);if(t==="y"){var r=function(){return"gy"}();var d=".a".replace(new RegExp("a",r),".")==="..";if(d){a=false}}}catch(t){a=false}return a}var U=hasNativeFlag("u");var j=hasNativeFlag("y");var B={g:true,i:true,m:true,u:U,y:j};function augment(t,a,r,d,i){var o;t[T]={captureNames:a};if(i){return t}if(t.__proto__){t.__proto__=XRegExp.prototype}else{for(var p in XRegExp.prototype){t[p]=XRegExp.prototype[p]}}t[T].source=r;t[T].flags=d?(0,S["default"])(o=d.split("")).call(o).join(""):d;return t}function clipDuplicates(t){return O.replace.call(t,/([\s\S])(?=[\s\S]*\1)/g,"")}function copyRegex(t,a){var r;if(!XRegExp.isRegExp(t)){throw new TypeError("Type RegExp expected")}var d=t[T]||{};var i=getNativeFlags(t);var o="";var p="";var u=null;var l=null;a=a||{};if(a.removeG){p+="g"}if(a.removeY){p+="y"}if(p){i=O.replace.call(i,new RegExp("[".concat(p,"]+"),"g"),"")}if(a.addG){o+="g"}if(a.addY){o+="y"}if(o){i=clipDuplicates(i+o)}if(!a.isInternalOnly){if(d.source!==undefined){u=d.source}if((0,E["default"])(d)!=null){l=o?clipDuplicates((0,E["default"])(d)+o):(0,E["default"])(d)}}t=augment(new RegExp(a.source||t.source,i),hasNamedCapture(t)?(0,y["default"])(r=d.captureNames).call(r,0):null,u,l,a.isInternalOnly);return t}function dec(t){return(0,w["default"])(t,16)}function getContextualTokenSeparator(t,a,r){if(t.input[t.index-1]==="("||t.input[t.index+t[0].length]===")"||t.input[t.index-1]==="|"||t.input[t.index+t[0].length]==="|"||t.index<1||t.index+t[0].length>=t.input.length||O.test.call(/^\(\?[:=!]/,t.input.substr(t.index-3,3))||isQuantifierNext(t.input,t.index+t[0].length,r)){return""}return"(?:)"}function getNativeFlags(t){return M?(0,E["default"])(t):O.exec.call(/\/([a-z]*)$/i,RegExp.prototype.toString.call(t))[1]}function hasNamedCapture(t){return!!(t[T]&&t[T].captureNames)}function hex(t){return(0,w["default"])(t,10).toString(16)}function isQuantifierNext(t,a,r){var d="\\(\\?#[^)]*\\)";var i="#[^#\\n]*";var o="[?*+]|{\\d+(?:,\\d*)?}";return O.test.call((0,b["default"])(r).call(r,"x")?/^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/,(0,y["default"])(t).call(t,a))}function isType(t,a){return V.call(t)==="[object ".concat(a,"]")}function pad4(t){while(t.length<4){t="0".concat(t)}return t}function prepareFlags(t,a){if(clipDuplicates(a)!==a){throw new SyntaxError("Invalid duplicate regex flag ".concat(a))}t=O.replace.call(t,/^\(\?([\w$]+)\)/,(function(t,r){if(O.test.call(/[gy]/,r)){throw new SyntaxError("Cannot use flag g or y in mode modifier ".concat(t))}a=clipDuplicates(a+r);return""}));var r=_createForOfIteratorHelper(a),d;try{for(r.s();!(d=r.n()).done;){var i=d.value;if(!B[i]){throw new SyntaxError("Unknown regex flag ".concat(i))}}}catch(t){r.e(t)}finally{r.f()}return{pattern:t,flags:a}}function prepareOptions(t){var a={};if(isType(t,"String")){(0,_["default"])(XRegExp).call(XRegExp,t,/[^\s,]+/,(function(t){a[t]=true}));return a}return t}function registerFlag(t){if(!/^[\w$]$/.test(t)){throw new Error("Flag must be a single character A-Za-z0-9_$")}B[t]=true}function runTokens(t,a,r,d,i){var o=D.length;var p=t[r];var u=null;var l;var c;while(o--){c=D[o];if(c.leadChar&&c.leadChar!==p||c.scope!==d&&c.scope!=="all"||c.flag&&!(0,b["default"])(a).call(a,c.flag)){continue}l=XRegExp.exec(t,c.regex,r,"sticky");if(l){u={matchLength:l[0].length,output:c.handler.call(i,l,d,a),reparse:c.reparse};break}}return u}function setAstral(t){k.astral=t}function setNamespacing(t){k.namespacing=t}function toObject(t){if(t==null){throw new TypeError("Cannot convert null or undefined to object")}return t}function XRegExp(t,a){if(XRegExp.isRegExp(t)){if(a!==undefined){throw new TypeError("Cannot supply flags when copying a RegExp")}return copyRegex(t)}t=t===undefined?"":String(t);a=a===undefined?"":String(a);if(XRegExp.isInstalled("astral")&&!(0,b["default"])(a).call(a,"A")){a+="A"}if(!A[t]){A[t]={}}if(!A[t][a]){var r={hasNamedCapture:false,captureNames:[]};var d=N;var i="";var o=0;var p;var u=prepareFlags(t,a);var l=u.pattern;var c=(0,E["default"])(u);while(o<l.length){do{p=runTokens(l,c,o,d,r);if(p&&p.reparse){l=(0,y["default"])(l).call(l,0,o)+p.output+(0,y["default"])(l).call(l,o+p.matchLength)}}while(p&&p.reparsLine truncated
*/var T="xregexp";var k={astral:false,namespacing:false};var O={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split};var P={};var x={};var A={};var D=[];var N="default";var C="class";var I={default:/\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/,class:/\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/};var R=/\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g;var L=O.exec.call(/()??/,"")[1]===undefined;var M=(0,E["default"])(/x/)!==undefined;var G={},V=G.toString;function hasNativeFlag(t){var a=true;try{new RegExp("",t);if(t==="y"){var r=function(){return"gy"}();var d=".a".replace(new RegExp("a",r),".")==="..";if(d){a=false}}}catch(t){a=false}return a}var U=hasNativeFlag("u");var j=hasNativeFlag("y");var B={g:true,i:true,m:true,u:U,y:j};function augment(t,a,r,d,i){var o;t[T]={captureNames:a};if(i){return t}if(t.__proto__){t.__proto__=XRegExp.prototype}else{for(var p in XRegExp.prototype){t[p]=XRegExp.prototype[p]}}t[T].source=r;t[T].flags=d?(0,S["default"])(o=d.split("")).call(o).join(""):d;return t}function clipDuplicates(t){return O.replace.call(t,/([\s\S])(?=[\s\S]*\1)/g,"")}function copyRegex(t,a){var r;if(!XRegExp.isRegExp(t)){throw new TypeError("Type RegExp expected")}var d=t[T]||{};var i=getNativeFlags(t);var o="";var p="";var u=null;var l=null;a=a||{};if(a.removeG){p+="g"}if(a.removeY){p+="y"}if(p){i=O.replace.call(i,new RegExp("[".concat(p,"]+"),"g"),"")}if(a.addG){o+="g"}if(a.addY){o+="y"}if(o){i=clipDuplicates(i+o)}if(!a.isInternalOnly){if(d.source!==undefined){u=d.source}if((0,E["default"])(d)!=null){l=o?clipDuplicates((0,E["default"])(d)+o):(0,E["default"])(d)}}t=augment(new RegExp(a.source||t.source,i),hasNamedCapture(t)?(0,y["default"])(r=d.captureNames).call(r,0):null,u,l,a.isInternalOnly);return t}function dec(t){return(0,w["default"])(t,16)}function getContextualTokenSeparator(t,a,r){if(t.input[t.index-1]==="("||t.input[t.index+t[0].length]===")"||t.input[t.index-1]==="|"||t.input[t.index+t[0].length]==="|"||t.index<1||t.index+t[0].length>=t.input.length||O.test.call(/^\(\?[:=!]/,t.input.substr(t.index-3,3))||isQuantifierNext(t.input,t.index+t[0].length,r)){return""}return"(?:)"}function getNativeFlags(t){return M?(0,E["default"])(t):O.exec.call(/\/([a-z]*)$/i,RegExp.prototype.toString.call(t))[1]}function hasNamedCapture(t){return!!(t[T]&&t[T].captureNames)}function hex(t){return(0,w["default"])(t,10).toString(16)}function isQuantifierNext(t,a,r){var d="\\(\\?#[^)]*\\)";var i="#[^#\\n]*";var o="[?*+]|{\\d+(?:,\\d*)?}";return O.test.call((0,b["default"])(r).call(r,"x")?/^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/,(0,y["default"])(t).call(t,a))}function isType(t,a){return V.call(t)==="[object ".concat(a,"]")}function pad4(t){while(t.length<4){t="0".concat(t)}return t}function prepareFlags(t,a){if(clipDuplicates(a)!==a){throw new SyntaxError("Invalid duplicate regex flag ".concat(a))}t=O.replace.call(t,/^\(\?([\w$]+)\)/,(function(t,r){if(O.test.call(/[gy]/,r)){throw new SyntaxError("Cannot use flag g or y in mode modifier ".concat(t))}a=clipDuplicates(a+r);return""}));var r=_createForOfIteratorHelper(a),d;try{for(r.s();!(d=r.n()).done;){var i=d.value;if(!B[i]){throw new SyntaxError("Unknown regex flag ".concat(i))}}}catch(t){r.e(t)}finally{r.f()}return{pattern:t,flags:a}}function prepareOptions(t){var a={};if(isType(t,"String")){(0,_["default"])(XRegExp).call(XRegExp,t,/[^\s,]+/,(function(t){a[t]=true}));return a}return t}function registerFlag(t){if(!/^[\w$]$/.test(t)){throw new Error("Flag must be a single character A-Za-z0-9_$")}B[t]=true}function runTokens(t,a,r,d,i){var o=D.length;var p=t[r];var u=null;var l;var c;while(o--){c=D[o];if(c.leadChar&&c.leadChar!==p||c.scope!==d&&c.scope!=="all"||c.flag&&!(0,b["default"])(a).call(a,c.flag)){continue}l=XRegExp.exec(t,c.regex,r,"sticky");if(l){u={matchLength:l[0].length,output:c.handler.call(i,l,d,a),reparse:c.reparse};break}}return u}function setAstral(t){k.astral=t}function setNamespacing(t){k.namespacing=t}function toObject(t){if(t==null){throw new TypeError("Cannot convert null or undefined to object")}return t}function XRegExp(t,a){if(XRegExp.isRegExp(t)){if(a!==undefined){throw new TypeError("Cannot supply flags when copying a RegExp")}return copyRegex(t)}t=t===undefined?"":String(t);a=a===undefined?"":String(a);if(XRegExp.isInstalled("astral")&&!(0,b["default"])(a).call(a,"A")){a+="A"}if(!A[t]){A[t]={}}if(!A[t][a]){var r={hasNamedCapture:false,captureNames:[]};var d=N;var i="";var o=0;var p;var u=prepareFlags(t,a);var l=u.pattern;var c=(0,E["default"])(u);while(o<l.length){do{p=runTokens(l,c,o,d,r);if(p&&p.reparse){l=(0,y["default"])(l).call(l,0,o)+p.output+(0,y["default"])(l).call(l,o+p.matchLength)}}while(p&&p.reparsLine truncated
//# sourceMappingURL=index.js.map
Generated Vendored
+1 -1
View File
@@ -1 +1 @@
{"version":3,"sources":["../webpack:/docker-metadata-action/node_modules/@actions/core/lib/command.js","../webpack:/docker-metadata-action/node_modules/@actions/core/lib/core.js","../webpack:/docker-metadata-action/node_modules/@actions/core/lib/file-command.js","../webpack:/docker-metadata-action/node_modules/@actions/core/lib/oidc-utils.js","../webpack:/docker-metadata-action/node_modules/@actions/core/lib/utils.js","../webpack:/docker-metadata-action/node_modules/@actions/github/lib/context.js","../webpack:/docker-metadata-action/node_modules/@actions/github/lib/github.js","../webpack:/docker-metadata-action/node_modules/@actions/github/lib/internal/utils.js","../webpack:/docker-metadata-action/node_modules/@actions/github/lib/utils.js","../webpack:/docker-metadata-action/node_modules/@actions/http-client/auth.js","../webpack:/docker-metadata-action/node_modules/@actions/http-client/index.js","../webpack:/docker-metadata-action/node_modules/@actions/http-client/proxy.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/array/from.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/array/is-array.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/flags.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/for-each.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/sort.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/object/create.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/parse-int.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/symbol.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/array/from.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/array/is-array.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/get-iterator-method.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/get-iterator.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/instance/slice.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/symbol.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/arrayLikeToArray.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/arrayWithHoles.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/interopRequireDefault.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/iterableToArrayLimit.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/nonIterableRest.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/unsupportedIterableToArray.js","../webpack:/docker-metadata-action/node_modules/@octokit/auth-token/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/core/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/endpoint/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/graphql/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/graphql/node_modules/@octokit/request-error/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/graphql/node_modules/@octokit/request/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/request/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/request/node_modules/@octokit/request-error/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@renovate/pep440/index.js","../webpack:/docker-metadata-action/node_modLine truncated
{"version":3,"sources":["../webpack:/docker-metadata-action/node_modules/@actions/core/lib/command.js","../webpack:/docker-metadata-action/node_modules/@actions/core/lib/core.js","../webpack:/docker-metadata-action/node_modules/@actions/core/lib/file-command.js","../webpack:/docker-metadata-action/node_modules/@actions/core/lib/oidc-utils.js","../webpack:/docker-metadata-action/node_modules/@actions/core/lib/utils.js","../webpack:/docker-metadata-action/node_modules/@actions/github/lib/context.js","../webpack:/docker-metadata-action/node_modules/@actions/github/lib/github.js","../webpack:/docker-metadata-action/node_modules/@actions/github/lib/internal/utils.js","../webpack:/docker-metadata-action/node_modules/@actions/github/lib/utils.js","../webpack:/docker-metadata-action/node_modules/@actions/http-client/auth.js","../webpack:/docker-metadata-action/node_modules/@actions/http-client/index.js","../webpack:/docker-metadata-action/node_modules/@actions/http-client/proxy.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/array/from.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/array/is-array.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/flags.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/for-each.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/sort.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/object/create.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/parse-int.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/symbol.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/array/from.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/array/is-array.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/get-iterator-method.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/get-iterator.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/instance/slice.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/symbol.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/arrayLikeToArray.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/arrayWithHoles.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/interopRequireDefault.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/iterableToArrayLimit.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/nonIterableRest.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/unsupportedIterableToArray.js","../webpack:/docker-metadata-action/node_modules/@octokit/auth-token/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/core/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/endpoint/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/graphql/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/graphql/node_modules/@octokit/request-error/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/graphql/node_modules/@octokit/request/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/request/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@octokit/request/node_modules/@octokit/request-error/dist-node/index.js","../webpack:/docker-metadata-action/node_modules/@renovate/pep440/index.js","../webpack:/docker-metadata-action/node_modLine truncated
+3 -3
View File
@@ -22,7 +22,7 @@ export function Transform(inputs: string[]): Image[] {
.split('=')
.map(item => item.trim());
if (parts.length == 1) {
images.push({name: parts[0].toLowerCase(), enable: true});
images.push({name: parts[0], enable: true});
} else {
newformat = true;
break;
@@ -46,13 +46,13 @@ export function Transform(inputs: string[]): Image[] {
.split('=')
.map(item => item.trim());
if (parts.length == 1) {
image.name = parts[0].toLowerCase();
image.name = parts[0];
} else {
const key = parts[0].toLowerCase();
const value = parts[1];
switch (key) {
case 'name': {
image.name = value.toLowerCase();
image.name = value;
break;
}
case 'enable': {
+19 -9
View File
@@ -224,7 +224,7 @@ export class Meta {
if (tag.attrs['value'].length > 0) {
vraw = this.setGlobalExp(tag.attrs['value']);
} else {
vraw = this.context.ref.replace(/^refs\/tags\//g, '').replace(/\//g, '-');
vraw = this.context.ref.replace(/^refs\/tags\//g, '');
}
let tmatch;
@@ -251,7 +251,7 @@ export class Meta {
if (!/^refs\/heads\//.test(this.context.ref)) {
return version;
}
const vraw = this.setValue(this.context.ref.replace(/^refs\/heads\//g, '').replace(/[^a-zA-Z0-9._-]+/g, '-'), tag);
const vraw = this.setValue(this.context.ref.replace(/^refs\/heads\//g, ''), tag);
return Meta.setVersion(version, vraw, this.flavor.latest == 'auto' ? false : this.flavor.latest == 'true');
}
@@ -259,7 +259,7 @@ export class Meta {
if (!/^refs\/tags\//.test(this.context.ref)) {
return version;
}
const vraw = this.setValue(this.context.ref.replace(/^refs\/tags\//g, '').replace(/\//g, '-'), tag);
const vraw = this.setValue(this.context.ref.replace(/^refs\/tags\//g, ''), tag);
return Meta.setVersion(version, vraw, this.flavor.latest == 'auto' ? true : this.flavor.latest == 'true');
}
@@ -277,7 +277,7 @@ export class Meta {
return version;
}
const val = this.context.ref.replace(/^refs\/heads\//g, '').replace(/[^a-zA-Z0-9._-]+/g, '-');
const val = this.context.ref.replace(/^refs\/heads\//g, '');
if (tag.attrs['branch'].length == 0) {
tag.attrs['branch'] = this.repo.default_branch;
}
@@ -312,6 +312,7 @@ export class Meta {
if (val.length == 0) {
return version;
}
val = Meta.sanitizeTag(val);
if (version.main == undefined) {
version.main = val;
} else if (val !== version.main) {
@@ -357,20 +358,20 @@ export class Meta {
if (!/^refs\/heads\//.test(ctx.ref)) {
return '';
}
return ctx.ref.replace(/^refs\/heads\//g, '').replace(/[^a-zA-Z0-9._-]+/g, '-');
return ctx.ref.replace(/^refs\/heads\//g, '');
},
tag: function () {
if (!/^refs\/tags\//.test(ctx.ref)) {
return '';
}
return ctx.ref.replace(/^refs\/tags\//g, '').replace(/\//g, '-');
return ctx.ref.replace(/^refs\/tags\//g, '');
},
sha: function () {
return ctx.sha.substr(0, 7);
},
base_ref: function () {
if (/^refs\/tags\//.test(ctx.ref) && ctx.payload?.base_ref != undefined) {
return ctx.payload.base_ref.replace(/^refs\/heads\//g, '').replace(/\//g, '-');
return ctx.payload.base_ref.replace(/^refs\/heads\//g, '');
}
// FIXME: keep this for backward compatibility even if doesn't always seem
// to return the expected branch. See the comment below.
@@ -413,7 +414,7 @@ export class Meta {
if (!image.enable) {
continue;
}
images.push(image.name);
images.push(Meta.sanitizeImageName(image.name));
}
return images;
}
@@ -429,7 +430,8 @@ export class Meta {
tags.push(`${imageName}:${partial}`);
}
if (this.version.latest) {
tags.push(`${imageName}:${this.flavor.prefixLatest ? this.flavor.prefix : ''}latest${this.flavor.suffixLatest ? this.flavor.suffix : ''}`);
const latestTag = `${this.flavor.prefixLatest ? this.flavor.prefix : ''}latest${this.flavor.suffixLatest ? this.flavor.suffix : ''}`;
tags.push(`${imageName}:${Meta.sanitizeTag(latestTag)}`);
}
}
return tags;
@@ -495,4 +497,12 @@ export class Meta {
return bakeFile;
}
private static sanitizeImageName(name: string): string {
return name.toLowerCase();
}
private static sanitizeTag(tag: string): string {
return tag.replace(/[^a-zA-Z0-9._-]+/g, '-');
}
}