Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance error log in case of a fatal error building the changelog #1333

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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