Skip to content

Commit

Permalink
- Enhance error log in case of a fatal error building the changelog
Browse files Browse the repository at this point in the history
  - RELATES TO #1331
  • Loading branch information
mikepenz authored Apr 11, 2024
1 parent 9784d5c commit 94fb581
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
9 changes: 4 additions & 5 deletions __tests__/tags.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { validateTransformer } from '../src/pr-collector/regexUtils'
import {validateTransformer} from '../src/pr-collector/regexUtils'
import {filterTags, prepareAndSortTags, TagInfo, transformTags} from '../src/pr-collector/tags'

jest.setTimeout(180000)
Expand Down Expand Up @@ -147,7 +147,6 @@ it('Should filter tags correctly using the regex (inverse)', async () => {
expect(filtered).toStrictEqual(`0.1.0-b01,1.0.0,1.0.0-a01,2.0.0,10.1.0,20.0.2`)
})


it('Should transform tags correctly using the regex', async () => {
const tags: TagInfo[] = [
{name: 'api-0.0.1', commit: ''},
Expand All @@ -163,13 +162,13 @@ it('Should transform tags correctly using the regex', async () => {
const tagResolver = {
method: 'non-existing-method',
transformer: {
pattern: '(api\-)?(.+)',
target: "$2"
pattern: '(api-)?(.+)',
target: '$2'
}
}

const transformer = validateTransformer(tagResolver.transformer)
if(transformer != null) {
if (transformer != null) {
const transformed = transformTags(tags, transformer)
.map(function (tag) {
return tag.name
Expand Down
1 change: 1 addition & 0 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.

1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ async function run(): Promise<void> {
}
} catch (error: any /* eslint-disable-line @typescript-eslint/no-explicit-any */) {
core.setFailed(error.message)
core.error(`🔥 Failed to generate changelog due to ${JSON.stringify(error)}`)
}
}

Expand Down

0 comments on commit 94fb581

Please sign in to comment.