PEP 440 support

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2021-07-06 13:56:48 +02:00
parent 8a0bc9fddd
commit a1770d2eba
14 changed files with 10946 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ import * as core from '@actions/core';
export enum Type {
Schedule = 'schedule',
Semver = 'semver',
Pep440 = 'pep440',
Match = 'match',
Edge = 'edge',
Ref = 'ref',
@@ -42,6 +43,7 @@ export class Tag {
export const DefaultPriorities: Record<Type, string> = {
[Type.Schedule]: '1000',
[Type.Semver]: '900',
[Type.Pep440]: '900',
[Type.Match]: '800',
[Type.Edge]: '700',
[Type.Ref]: '600',
@@ -124,7 +126,8 @@ export function Parse(s: string): Tag {
}
break;
}
case Type.Semver: {
case Type.Semver:
case Type.Pep440: {
if (!tag.attrs.hasOwnProperty('pattern')) {
throw new Error(`Missing pattern attribute for ${s}`);
}