Skip to content

Commit

Permalink
Fix package names pulled from body (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangoslen authored Nov 25, 2023
1 parent a1de011 commit b97db70
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 164 deletions.
6 changes: 3 additions & 3 deletions __tests__/entry-extractor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,19 @@ test('extracts mulitple entries from body', async () => {
expect(entries).toHaveLength(3)

let entry = entries[0]
expect(entry.package).toStrictEqual('`package`')
expect(entry.package).toStrictEqual('package')
expect(entry.repository).toStrictEqual('owner/repo')
expect(entry.oldVersion).toStrictEqual('0.30.7')
expect(entry.newVersion).toStrictEqual('0.32.6')

entry = entries[1]
expect(entry.package).toStrictEqual('`another-package`')
expect(entry.package).toStrictEqual('another-package')
expect(entry.repository).toStrictEqual('owner/repo')
expect(entry.oldVersion).toStrictEqual('4.25.7')
expect(entry.newVersion).toStrictEqual('5.12.9')

entry = entries[2]
expect(entry.package).toStrictEqual('`yet-another-package`')
expect(entry.package).toStrictEqual('yet-another-package')
expect(entry.repository).toStrictEqual('owner/repo')
expect(entry.oldVersion).toStrictEqual('2.24.0')
expect(entry.newVersion).toStrictEqual('3.12.3')
Expand Down
286 changes: 128 additions & 158 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.

4 changes: 3 additions & 1 deletion src/entry-extractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ function getEntriesFromBody(
entries.push({
pullRequestNumber,
repository,
package: match[1],

// Remove redundant '`' characters on pacakges pulled from the body
package: match[1].replaceAll('`', ''),
oldVersion: match[2],
newVersion: match[3]
})
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"target": "ES2021", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"outDir": "./lib", /* Redirect output structure to the directory. */
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
Expand Down

0 comments on commit b97db70

Please sign in to comment.