Skip to content

Commit

Permalink
Refactor getNextReleaseType function to handle different release stra…
Browse files Browse the repository at this point in the history
…tegies
  • Loading branch information
crs-k committed Apr 6, 2024
1 parent fc21da3 commit a33e52d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
9 changes: 6 additions & 3 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.

8 changes: 5 additions & 3 deletions src/functions/get-next-release-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export async function getNextReleaseType(previousReleaseType: string): Promise<s
let nextReleaseType = ''

try {
if (previousReleaseType === 'production') {
if (releaseStrategy === 'single') {
nextReleaseType = 'production'
} else if (previousReleaseType === 'production') {
if (releaseStrategy === 'triple') {
nextReleaseType = 'alpha'
} else if (releaseStrategy === 'double') {
Expand All @@ -20,9 +22,9 @@ export async function getNextReleaseType(previousReleaseType: string): Promise<s
nextReleaseType = 'production'
}

assert(nextReleaseType, 'previous release type cannot be empty')
assert(nextReleaseType, 'next release type cannot be empty')
} catch (err) {
core.info('Failed to find previous release type.')
core.info('Failed to find next release type.')
nextReleaseType = ''
}
const data = nextReleaseType
Expand Down

0 comments on commit a33e52d

Please sign in to comment.