Skip to content

Commit

Permalink
Merge to v4 2024 10 03 01 (#67)
Browse files Browse the repository at this point in the history
merge v4-beta to v4
  • Loading branch information
mike-ainsel authored Oct 3, 2024
1 parent dfd44f2 commit 7809581
Show file tree
Hide file tree
Showing 12 changed files with 2,212 additions and 7,315 deletions.
8 changes: 3 additions & 5 deletions actions/detect-version/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function genDevVersion(
baseRef: string
): Promise<version.versionInfo> {
const currentRefName = process.env.GITHUB_REF_NAME as string
const sanitizedRefName = utils.sanitizeVersionInput(currentRefName)
const sanitizedRefName = version.sanitize(currentRefName)
const count = await git.countCommits(baseRef, 'HEAD')

return {
Expand All @@ -48,9 +48,8 @@ async function loadBranchVersions(targetBranch: string): Promise<void> {
const runNumber: string = process.env.GITHUB_RUN_NUMBER as string
const currentSha: string = await git.resolveRef('HEAD')
const currentVersionStr = `${runNumber}-${currentSha.substring(0, 8)}`
const sanitizedRefName = utils.sanitizeVersionInput(currentVersionStr)

const currentVersion = version.parse(sanitizedRefName)
const currentVersion = version.sanitize(currentVersionStr)
const isRelease = refType === 'branch' && refName === targetBranch
const isBranchHead = await utils.isBranchHead()

Expand Down Expand Up @@ -83,8 +82,7 @@ async function getSanitizedVersion(
): Promise<version.versionInfo | null> {
const originalVersion = knownVersions[tag]
if (originalVersion && originalVersion.original) {
const sanitizedStr = utils.sanitizeVersionInput(originalVersion.original)
return version.parse(sanitizedStr)
return version.sanitize(originalVersion.original)
}
// Handle the case where version parsing fails or original is missing
return null
Expand Down
8 changes: 0 additions & 8 deletions actions/detect-version/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,6 @@ export function isLatestMajor(
}
return false
}
/**
Check an input string and replace all characters that
do not conform to semantic versioning (semver) criteria with the - character
*/
export function sanitizeVersionInput(input: string): string {
const regex = /[^0-9A-Za-z.+-]/g
return input.replace(regex, '-')
}

/**
Filter out tags that are not valid semantic versions
Expand Down
30 changes: 30 additions & 0 deletions actions/node_modules/milib/__tests__/version.test.ts

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

58 changes: 26 additions & 32 deletions actions/node_modules/milib/lib/git.d.ts

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

29 changes: 14 additions & 15 deletions actions/node_modules/milib/lib/git.js

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

3 changes: 1 addition & 2 deletions actions/node_modules/milib/lib/string.js

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

30 changes: 23 additions & 7 deletions actions/node_modules/milib/lib/version.d.ts

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

Loading

0 comments on commit 7809581

Please sign in to comment.