mirror of
https://github.com/docker/metadata-action.git
synced 2026-01-18 01:58:28 +00:00
Merge pull request #537 from crazy-max/pep440-match
Some checks failed
test / test (push) Has been cancelled
validate / prepare (push) Has been cancelled
validate / validate (push) Has been cancelled
ci / context (workflow) (push) Successful in 6s
ci / tag-semver (false) (push) Has been cancelled
ci / tag-semver (true) (push) Has been cancelled
ci / flavor (push) Has been cancelled
ci / custom-labels-annotations (push) Has been cancelled
ci / global-exps (push) Has been cancelled
ci / json (push) Has been cancelled
ci / docker-push (push) Has been cancelled
ci / bake (push) Has been cancelled
ci / multi-images (push) Successful in 2m50s
ci / context (git) (push) Successful in 1m26s
ci / images (push) Has been cancelled
ci / no-images (push) Has been cancelled
ci / bake-path-context (push) Has been cancelled
ci / sha-short () (push) Has been cancelled
ci / tag-schedule ({{date 'YYYYMMDD-HHmmss'}}) (push) Has been cancelled
ci / tag-match (\d.\d, 0) (push) Has been cancelled
ci / tag-match (\d.\d.\d, 0) (push) Has been cancelled
ci / tag-match (v(.*), 1) (push) Has been cancelled
ci / tag-semver (auto) (push) Has been cancelled
ci / sep-tags ( ) (push) Has been cancelled
ci / sep-tags (,) (push) Has been cancelled
ci / output-env (push) Has been cancelled
ci / no-output-env (push) Has been cancelled
ci / bake-annotations (push) Has been cancelled
ci / sha-short (16) (push) Has been cancelled
ci / dump (push) Has been cancelled
ci / tag-schedule (schedule) (push) Successful in 2m41s
ci / tag-schedule () (push) Successful in 2m49s
ci / tag-schedule (cron-{{date 'YYYYMMDD'}}) (push) Successful in 2m44s
Some checks failed
test / test (push) Has been cancelled
validate / prepare (push) Has been cancelled
validate / validate (push) Has been cancelled
ci / context (workflow) (push) Successful in 6s
ci / tag-semver (false) (push) Has been cancelled
ci / tag-semver (true) (push) Has been cancelled
ci / flavor (push) Has been cancelled
ci / custom-labels-annotations (push) Has been cancelled
ci / global-exps (push) Has been cancelled
ci / json (push) Has been cancelled
ci / docker-push (push) Has been cancelled
ci / bake (push) Has been cancelled
ci / multi-images (push) Successful in 2m50s
ci / context (git) (push) Successful in 1m26s
ci / images (push) Has been cancelled
ci / no-images (push) Has been cancelled
ci / bake-path-context (push) Has been cancelled
ci / sha-short () (push) Has been cancelled
ci / tag-schedule ({{date 'YYYYMMDD-HHmmss'}}) (push) Has been cancelled
ci / tag-match (\d.\d, 0) (push) Has been cancelled
ci / tag-match (\d.\d.\d, 0) (push) Has been cancelled
ci / tag-match (v(.*), 1) (push) Has been cancelled
ci / tag-semver (auto) (push) Has been cancelled
ci / sep-tags ( ) (push) Has been cancelled
ci / sep-tags (,) (push) Has been cancelled
ci / output-env (push) Has been cancelled
ci / no-output-env (push) Has been cancelled
ci / bake-annotations (push) Has been cancelled
ci / sha-short (16) (push) Has been cancelled
ci / dump (push) Has been cancelled
ci / tag-schedule (schedule) (push) Successful in 2m41s
ci / tag-schedule () (push) Successful in 2m49s
ci / tag-schedule (cron-{{date 'YYYYMMDD'}}) (push) Successful in 2m44s
allow to match part of the git tag or value for pep440 type
This commit is contained in:
2
dist/index.js
generated
vendored
2
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
16
src/meta.ts
16
src/meta.ts
@@ -169,7 +169,7 @@ export class Meta {
|
||||
if (!tmatch) {
|
||||
core.warning(`${tag.attrs['match']} does not match ${vraw}.`);
|
||||
} else {
|
||||
vraw = this.setValue(tmatch[1], tag);
|
||||
vraw = tmatch[1];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,8 +207,20 @@ 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, '');
|
||||
}
|
||||
|
||||
if (tag.attrs['match'].length > 0) {
|
||||
const tmatch = vraw.match(tag.attrs['match']);
|
||||
if (!tmatch) {
|
||||
core.warning(`${tag.attrs['match']} does not match ${vraw}.`);
|
||||
} else {
|
||||
vraw = tmatch[1];
|
||||
}
|
||||
}
|
||||
|
||||
vraw = vraw.replace(/\//g, '-');
|
||||
|
||||
if (!pep440.valid(vraw)) {
|
||||
core.warning(`${vraw} does not conform to PEP 440. More info: https://www.python.org/dev/peps/pep-0440`);
|
||||
return version;
|
||||
|
||||
Reference in New Issue
Block a user