Skip to content

Commit

Permalink
fix(changelog-github): Throw descriptive error when no options (#298)
Browse files Browse the repository at this point in the history
* fix(changelog-github): Throw descriptive error when no options

* Create sour-hats-hear.md

Co-authored-by: Ben Conolly <ben@thinkmill.com.au>
  • Loading branch information
eps1lon and Noviny committed Mar 28, 2020
1 parent f930a68 commit e56928b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/sour-hats-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@changesets/changelog-github": patch
"@changesets/types": patch
---

In changelog-github, throw more descriptive error when no options are provided.
2 changes: 1 addition & 1 deletion packages/changelog-github/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const changelogFunctions: ChangelogFunctions = {
return [changesetLink, ...updatedDepenenciesList].join("\n");
},
getReleaseLine: async (changeset, type, options) => {
if (!options.repo) {
if (!options || !options.repo) {
throw new Error(
'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]'
);
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export type ModCompWithPackage = ComprehensiveRelease & {
export type GetReleaseLine = (
changeset: NewChangesetWithCommit,
type: VersionType,
changelogOpts: any
changelogOpts: null | Record<string, any>
) => Promise<string>;

export type GetDependencyReleaseLine = (
Expand Down

0 comments on commit e56928b

Please sign in to comment.