Skip to content

Commit

Permalink
Fix semver regex bug
Browse files Browse the repository at this point in the history
  • Loading branch information
medallyon committed Aug 12, 2021
1 parent 71e836d commit 07e3399
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 31 deletions.
209 changes: 180 additions & 29 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function run()
const payload = github.context.payload
, tag = payload.release.tag_name;

if (!(/^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/gm.test(tag)))
if (!/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/gm.test(tag))
core.setFailed("Release Tag does not match semantic versioning.");

const pkg = await fs.readJson("./package.json")
Expand Down

0 comments on commit 07e3399

Please sign in to comment.