Skip to content

Commit

Permalink
fix: pass context to resolveConfig
Browse files Browse the repository at this point in the history
The `resolveConfig` method from `semantic-release`'s internals had previously not made use of its second argument.

[Fixes #28]
  • Loading branch information
pmowrer committed Sep 11, 2018
1 parent 09bf7f6 commit 376a411
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/github-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ const { parse } = require('url');
* https://github.com/semantic-release/github/blob/d49ce22a7c2d4b0861de31ba00c0b213b23e5051/lib/publish.js#L11
*
* @param pluginConfig The config object passed to `semantic-release` plugins.
* @param context The context object passed to `semantic-release` plugins.
* @returns An initialized instance of `github`.
*/
module.exports = pluginConfig => {
module.exports = (pluginConfig, context) => {
const { githubToken, githubUrl, githubApiPathPrefix } = resolveConfig(
pluginConfig
pluginConfig, context
);

let { port, protocol, hostname: host } = githubUrl ? parse(githubUrl) : {};
Expand Down
2 changes: 1 addition & 1 deletion src/with-github.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const githubRepo = require('./github-repo');
const parseGithubUrl = require('parse-github-url');

const withGithub = plugin => (pluginConfig, context) => {
const github = githubInit(pluginConfig);
const github = githubInit(pluginConfig, context);
const { options: { repositoryUrl } } = context;
const { name: repo, owner } = parseGithubUrl(repositoryUrl);

Expand Down

0 comments on commit 376a411

Please sign in to comment.