mirror of
https://github.com/docker/metadata-action.git
synced 2025-12-06 07:48:16 +08:00
Merge pull request #537 from crazy-max/pep440-match
Some checks failed
test / test (push) Failing after 21s
validate / prepare (push) Failing after 21s
validate / validate (push) Has been skipped
ci / context (git) (push) Successful in 35s
ci / context (workflow) (push) Successful in 34s
ci / multi-images (push) Failing after 21s
ci / tag-schedule () (push) Failing after 21s
ci / tag-schedule (cron-{{date 'YYYYMMDD'}}) (push) Failing after 21s
ci / tag-schedule (schedule) (push) Failing after 21s
ci / tag-schedule ({{date 'YYYYMMDD-HHmmss'}}) (push) Failing after 21s
ci / tag-match (\d.\d, 0) (push) Failing after 21s
ci / tag-match (\d.\d.\d, 0) (push) Failing after 21s
ci / tag-match (v(.*), 1) (push) Failing after 21s
ci / tag-semver (auto) (push) Failing after 21s
ci / tag-semver (false) (push) Failing after 21s
ci / tag-semver (true) (push) Failing after 21s
ci / flavor (push) Failing after 20s
ci / images (push) Failing after 20s
ci / custom-labels-annotations (push) Failing after 21s
ci / global-exps (push) Failing after 21s
ci / json (push) Failing after 21s
ci / docker-push (push) Failing after 1m14s
ci / bake (push) Failing after 21s
ci / sep-tags ( ) (push) Failing after 21s
ci / sep-tags (,) (push) Failing after 20s
ci / output-env (push) Failing after 20s
ci / no-output-env (push) Successful in 34s
ci / bake-annotations (push) Failing after 20s
ci / no-images (push) Failing after 20s
ci / bake-path-context (push) Failing after 21s
ci / sha-short () (push) Failing after 20s
ci / sha-short (16) (push) Failing after 20s
ci / dump (push) Failing after 21s
Some checks failed
test / test (push) Failing after 21s
validate / prepare (push) Failing after 21s
validate / validate (push) Has been skipped
ci / context (git) (push) Successful in 35s
ci / context (workflow) (push) Successful in 34s
ci / multi-images (push) Failing after 21s
ci / tag-schedule () (push) Failing after 21s
ci / tag-schedule (cron-{{date 'YYYYMMDD'}}) (push) Failing after 21s
ci / tag-schedule (schedule) (push) Failing after 21s
ci / tag-schedule ({{date 'YYYYMMDD-HHmmss'}}) (push) Failing after 21s
ci / tag-match (\d.\d, 0) (push) Failing after 21s
ci / tag-match (\d.\d.\d, 0) (push) Failing after 21s
ci / tag-match (v(.*), 1) (push) Failing after 21s
ci / tag-semver (auto) (push) Failing after 21s
ci / tag-semver (false) (push) Failing after 21s
ci / tag-semver (true) (push) Failing after 21s
ci / flavor (push) Failing after 20s
ci / images (push) Failing after 20s
ci / custom-labels-annotations (push) Failing after 21s
ci / global-exps (push) Failing after 21s
ci / json (push) Failing after 21s
ci / docker-push (push) Failing after 1m14s
ci / bake (push) Failing after 21s
ci / sep-tags ( ) (push) Failing after 21s
ci / sep-tags (,) (push) Failing after 20s
ci / output-env (push) Failing after 20s
ci / no-output-env (push) Successful in 34s
ci / bake-annotations (push) Failing after 20s
ci / no-images (push) Failing after 20s
ci / bake-path-context (push) Failing after 21s
ci / sha-short () (push) Failing after 20s
ci / sha-short (16) (push) Failing after 20s
ci / dump (push) Failing after 21s
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