Skip to content

Commit

Permalink
fix: semver regex (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonraid authored Nov 1, 2022
1 parent d9ac0f3 commit 29d3006
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/create_changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// Expecting brach to be named release/vX.Y.Z
const SEMVER_REGEX = new RegExp('^(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-]+)*))?$');
const SEMVER_REGEX = /^(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-]+)*))?$/;
const VERSION_PREFIX = '${{ inputs.releaseNamePrefix }}';
let releaseName;
Expand All @@ -67,7 +67,7 @@ jobs:
cleanVersion = version;
}
if (!SEMVER_REGEX.test(cleanVersion)) throw new Error('Version: ${version} does not uphold to semantic versioning standard!');
if (!SEMVER_REGEX.test(cleanVersion)) throw new Error(`Version: ${version} does not uphold to semantic versioning standard!`);
if (bump) {
const cleanVersionSplit = cleanVersion.split('.');
Expand Down

0 comments on commit 29d3006

Please sign in to comment.