2
0
Fork 0
mirror of https://code.forgejo.org/docker/metadata-action.git synced 2025-08-03 08:18:31 +00:00

Replace forbidden chars derived from branch name (#29)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-12-08 00:01:39 +01:00 committed by GitHub
parent 3ae5afe041
commit 7040b59aa5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 59 additions and 2 deletions

2
dist/index.js generated vendored
View file

@ -242,7 +242,7 @@ class Meta {
}
}
else if (/^refs\/heads\//.test(this.context.ref)) {
version.main = this.context.ref.replace(/^refs\/heads\//g, '').replace(/\//g, '-');
version.main = this.context.ref.replace(/^refs\/heads\//g, '').replace(/[^a-zA-Z0-9._-]+/g, '-');
if (this.inputs.tagEdge && this.inputs.tagEdgeBranch === version.main) {
version.main = 'edge';
}