nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: semantic-release/gitlab
Pull request #385 (2022-05-27 11:57:52)

fix(labels): allow disabling of labels as described in docs #383


Patch:
diff --git a/lib/verify.js b/lib/verify.js
index c68ee75..f31e1b2 100644
--- a/lib/verify.js
+++ b/lib/verify.js
@@ -19,7 +19,7 @@ const VALIDATORS = {
   ),
   failTitle: canBeDisabled(isNonEmptyString),
   failComment: canBeDisabled(isNonEmptyString),
-  labels: isNonEmptyString,
+  labels: canBeDisabled(isNonEmptyString),
   assignee: isNonEmptyString,
 };
 


Test patch:
diff --git a/test/verify.test.js b/test/verify.test.js
index d3d737d..5a88d95 100644
--- a/test/verify.test.js
+++ b/test/verify.test.js
@@ -645,6 +645,44 @@ test.serial('Throw SemanticReleaseError if "failComment" option is a whitespace
   t.true(gitlab.isDone());
 });
 
+test.serial('Does not throw SemanticReleaseError if "labels" option is a valid String', async (t) => {
+  const owner = 'test_user';
+  const repo = 'test_repo';
+  const env = {GITLAB_TOKEN: 'gitlab_token'};
+  const labels = 'semantic-release';
+  const gitlab = authenticate(env)
+    .get(`/projects/${owner}%2F${repo}`)
+    .reply(200, {permissions: {project_access: {access_level: 40}}});
+
+  await t.notThrowsAsync(
+    verify(
+      {labels},
+      {env, options: {repositoryUrl: `https://gitlab.com/${owner}/${repo}.git`}, logger: t.context.logger}
+    )
+  );
+
+  t.true(gitlab.isDone());
+});
+
+test.serial('Does not throw SemanticReleaseError if "labels" option is "false"', async (t) => {
+  const owner = 'test_user';
+  const repo = 'test_repo';
+  const env = {GITLAB_TOKEN: 'gitlab_token'};
+  const labels = false;
+  const gitlab = authenticate(env)
+    .get(`/projects/${owner}%2F${repo}`)
+    .reply(200, {permissions: {project_access: {access_level: 40}}});
+
+  await t.notThrowsAsync(
+    verify(
+      {labels},
+      {env, options: {repositoryUrl: `https://gitlab.com/${owner}/${repo}.git`}, logger: t.context.logger}
+    )
+  );
+
+  t.true(gitlab.isDone());
+});
+
 test.serial('Throw SemanticReleaseError if "labels" option is not a String', async (t) => {
   const owner = 'test_user';
   const repo = 'test_repo';
Repository: semantic-release/gitlab
Pull request #576 (2023-08-03 09:50:44)

fix: use numeric project ID for API calls
Before we used the project path, which can cause issues with some proxy or firewall setups that replace slashes in URLs.

Closes https://github.com/semantic-release/gitlab/issues/543


Patch:
diff --git a/lib/get-repo-id.js b/lib/get-repo-id.js
index f56cf82..f2aa251 100644
--- a/lib/get-repo-id.js
+++ b/lib/get-repo-id.js
@@ -1,9 +1,9 @@
 import parseUrl from "parse-url";
 import escapeStringRegexp from "escape-string-regexp";
 
-export default ({ envCi: { service } = {}, env: { CI_PROJECT_PATH } }, gitlabUrl, repositoryUrl) =>
-  service === "gitlab" && CI_PROJECT_PATH
-    ? CI_PROJECT_PATH
+export default ({ envCi: { service } = {}, env: { CI_PROJECT_ID } }, gitlabUrl, repositoryUrl) =>
+  service === "gitlab" && CI_PROJECT_ID
+    ? CI_PROJECT_ID
     : parseUrl(repositoryUrl)
         .pathname.replace(new RegExp(`^${escapeStringRegexp(parseUrl(gitlabUrl).pathname)}`), "")
         .replace(/^\//, "")


Test patch:
diff --git a/test/get-repo-id.test.js b/test/get-repo-id.test.js
index f7f09fc..202e393 100644
--- a/test/get-repo-id.test.js
+++ b/test/get-repo-id.test.js
@@ -41,18 +41,18 @@ test("Parse repo id with organization and subgroup", (t) => {
 test("Get repo id from GitLab CI", (t) => {
   t.is(
     getRepoId(
-      { envCi: { service: "gitlab" }, env: { CI_PROJECT_PATH: "other-owner/other-repo" } },
+      { envCi: { service: "gitlab" }, env: { CI_PROJECT_ID: "123" } },
       "https://gitlbab.com",
       "https://gitlab.com/owner/repo.git"
     ),
-    "other-owner/other-repo"
+    "123"
   );
 });
 
-test("Ignore CI_PROJECT_PATH if not on GitLab CI", (t) => {
+test("Ignore CI_PROJECT_ID if not on GitLab CI", (t) => {
   t.is(
     getRepoId(
-      { envCi: { service: "travis" }, env: { CI_PROJECT_PATH: "other-owner/other-repo" } },
+      { envCi: { service: "travis" }, env: { CI_PROJECT_ID: "123" } },
       "https://gitlbab.com",
       "https://gitlab.com/owner/repo.git"
     ),
Repository: semantic-release/gitlab
Pull request #680 (2024-02-19 13:03:56)

fix(fail): properly parse issue creation response to log in terminal
I realized in our logs, the `id` and `web_url` are not parsed properly. According to the docs the call to the method `.json()` was missing. Local tests showed this fixed the logs and did not affect the normal functionality.

fgreinacher: Thanks @JonasSchubert, the changes looks good. Can you please fix the email/signature in your commit so that GitHub is happy? 🙇 

<img width="855" alt="image" src="https://github.com/semantic-release/gitlab/assets/1540469/663b5ca2-8a93-42b9-a6a6-3442920e0b5e">

JonasSchubert: > Thanks @JonasSchubert, the changes looks good. Can you please fix the email/signature in your commit so that GitHub is happy? 🙇 
> 
> <img width="855" alt="image" src="https://github.com/semantic-release/gitlab/assets/1540469/663b5ca2-8a93-42b9-a6a6-3442920e0b5e">
> 

🙈 sorry. work email and private open source email. Will fix that later today or tomorrow latest. 
JonasSchubert: @fgreinacher Updated email and gpg. Thanks for realizing that 🙇 

Patch:
diff --git a/lib/fail.js b/lib/fail.js
index 9ba63d6..d270623 100644
--- a/lib/fail.js
+++ b/lib/fail.js
@@ -53,10 +53,12 @@ export default async (pluginConfig, context) => {
       debug("create issue: %O", newIssue);
 
       /* eslint camelcase: off */
-      const { id, web_url } = await got.post(issuesEndpoint, {
-        ...apiOptions,
-        json: newIssue,
-      });
+      const { id, web_url } = await got
+        .post(issuesEndpoint, {
+          ...apiOptions,
+          json: newIssue,
+        })
+        .json();
       logger.log("Created issue #%d: %s.", id, web_url);
     }
   }


Test patch:
diff --git a/test/fail.test.js b/test/fail.test.js
index 839cd28..d56ca29 100644
--- a/test/fail.test.js
+++ b/test/fail.test.js
@@ -72,11 +72,16 @@ Your **[semantic-release](https://github.com/semantic-release/semantic-release)*
       labels: "semantic-release",
       title: "The automated release is failing 🚨",
     })
-    .reply(200);
+    .reply(200, { id: 3, web_url: "https://gitlab.com/test_user/test_repo/-/issues/3" });
 
   await fail(pluginConfig, { env, options, branch, errors, logger: t.context.logger });
 
   t.true(gitlab.isDone());
+  t.deepEqual(t.context.log.args[0], [
+    "Created issue #%d: %s.",
+    3,
+    "https://gitlab.com/test_user/test_repo/-/issues/3",
+  ]);
 });
 
 test.serial("Post comments to existing issue", async (t) => {
Repository: semantic-release/gitlab
Pull request #712 (2024-05-07 14:42:52)

feat: improve output in case of errors during publish
This PR adds the message from the response body to the error if available.

Resolves https://github.com/semantic-release/gitlab/issues/684


Patch:
diff --git a/lib/publish.js b/lib/publish.js
index 18b336c..97e7561 100644
--- a/lib/publish.js
+++ b/lib/publish.js
@@ -28,7 +28,25 @@ export default async (pluginConfig, context) => {
   const encodedRepoId = encodeURIComponent(repoId);
   const encodedGitTag = encodeURIComponent(gitTag);
   const encodedVersion = encodeURIComponent(version);
-  const apiOptions = { headers: { "PRIVATE-TOKEN": gitlabToken } };
+  const apiOptions = {
+    headers: {
+      "PRIVATE-TOKEN": gitlabToken,
+    },
+    hooks: {
+      beforeError: [
+        (error) => {
+          const { response } = error;
+          if (response?.body && response.headers["content-type"] === "application/json") {
+            const parsedBody = JSON.parse(response.body);
+            if (parsedBody.message) {
+              error.message = `Response code ${response.statusCode} (${parsedBody.message})`;
+            }
+          }
+          return error;
+        },
+      ],
+    },
+  };
 
   debug("repoId: %o", repoId);
   debug("release name: %o", gitTag);


Test patch:
diff --git a/test/publish.test.js b/test/publish.test.js
index 78403ad..7c535c3 100644
--- a/test/publish.test.js
+++ b/test/publish.test.js
@@ -617,3 +617,27 @@ test.serial("Publish a release with an asset link", async (t) => {
   t.deepEqual(t.context.log.args[0], ["Published GitLab release: %s", nextRelease.gitTag]);
   t.true(gitlab.isDone());
 });
+
+test.serial("Publish a release with error response", async (t) => {
+  const owner = "test_user";
+  const repo = "test_repo";
+  const env = { GITLAB_TOKEN: "gitlab_token" };
+  const pluginConfig = {};
+  const nextRelease = { gitHead: "123", gitTag: "v1.0.0", notes: "Test release note body" };
+  const options = { repositoryUrl: `https://gitlab.com/${owner}/${repo}.git` };
+  const encodedRepoId = encodeURIComponent(`${owner}/${repo}`);
+  const encodedGitTag = encodeURIComponent(nextRelease.gitTag);
+  const gitlab = authenticate(env)
+    .post(`/projects/${encodedRepoId}/releases`, {
+      tag_name: nextRelease.gitTag,
+      description: nextRelease.notes,
+      assets: {
+        links: [],
+      },
+    })
+    .reply(499, { message: "Something went wrong" });
+
+  const error = await t.throwsAsync(publish(pluginConfig, { env, options, nextRelease, logger: t.context.logger }));
+  t.is(error.message, `Response code 499 (Something went wrong)`);
+  t.true(gitlab.isDone());
+});
Repository: semantic-release/npm
Pull request #163 (2019-05-22 21:37:13)

Honor NPM_CONFIG_USERCONFIG setting
This bug cost me weeks 😅

`npm` honors the `NPM_CONFIG_USERCONFIG` setting, which our CI relies on to inject shared credentials at runtime. `npm publish` succeeds if we're not using Semantic Release. However, `@semantic-release/npm` has reimplemented a credentials check in a manner not compatible with the way `npm` handles the user config environment variable. This PR checks the location specified in `NPM_CONFIG_USERCONFIG` before using `rc` to crawl up the file hierarchy.

It should be noted that `rc` does not fully implement the `.npmrc` resolution algorithm, skipping the ability to specify config files from an env var. That's why we're facing this problem.

I've tested this locally, and this small fix would allow us to use Semantic Release 🎉

gr2m: Thanks Ryan! Could you see if you can get the tests passed?
ryaninvents: @gr2m Thanks for the nudge! Fixed linting and also added a test for this case.

I force-pushed the branch because I realized I didn't write a semantic commit message; let me know if that's an issue and I can re-create the PR.

Patch:
diff --git a/lib/set-npmrc-auth.js b/lib/set-npmrc-auth.js
index da31684..40f65c9 100644
--- a/lib/set-npmrc-auth.js
+++ b/lib/set-npmrc-auth.js
@@ -6,9 +6,12 @@ const nerfDart = require('nerf-dart');
 const AggregateError = require('aggregate-error');
 const getError = require('./get-error');
 
-module.exports = async (registry, {cwd, env: {NPM_TOKEN, NPM_USERNAME, NPM_PASSWORD, NPM_EMAIL}, logger}) => {
+module.exports = async (
+  registry,
+  {cwd, env: {NPM_TOKEN, NPM_CONFIG_USERCONFIG, NPM_USERNAME, NPM_PASSWORD, NPM_EMAIL}, logger}
+) => {
   logger.log('Verify authentication for registry %s', registry);
-  const config = path.resolve(cwd, '.npmrc');
+  const config = NPM_CONFIG_USERCONFIG || path.resolve(cwd, '.npmrc');
   if (getAuthToken(registry, {npmrc: rc('npm', {registry: 'https://registry.npmjs.org/'}, {config})})) {
     return;
   }


Test patch:
diff --git a/test/set-npmrc-auth.test.js b/test/set-npmrc-auth.test.js
index 380790d..239c017 100644
--- a/test/set-npmrc-auth.test.js
+++ b/test/set-npmrc-auth.test.js
@@ -70,6 +70,20 @@ test('Throw error if "NPM_TOKEN" is missing', async t => {
   t.is(error.code, 'ENONPMTOKEN');
 });
 
+test('Emulate npm config resolution if "NPM_CONFIG_USERCONFIG" is set', async t => {
+  const cwd = tempy.directory();
+
+  await appendFile(path.resolve(cwd, '.custom-npmrc'), `//custom.registry.com/:_authToken = \${NPM_TOKEN}`);
+
+  await setNpmrcAuth('http://custom.registry.com', {
+    cwd,
+    env: {NPM_CONFIG_USERCONFIG: path.resolve(cwd, '.custom-npmrc')},
+    logger: t.context.logger,
+  });
+
+  t.is(t.context.log.callCount, 1);
+});
+
 test('Throw error if "NPM_USERNAME" is missing', async t => {
   const cwd = tempy.directory();
   const env = {NPM_PASSWORD: 'npm_pasword', NPM_EMAIL: 'npm_email'};
Repository: semantic-release/semantic-release
Pull request #623 (2018-01-27 23:07:31)

fix: hide sensitive info for `Buffer` and `undefined`


Patch:
diff --git a/lib/hide-sensitive.js b/lib/hide-sensitive.js
index 9d6e36b..cd5709e 100644
--- a/lib/hide-sensitive.js
+++ b/lib/hide-sensitive.js
@@ -1,11 +1,8 @@
 const {escapeRegExp} = require('lodash');
 
-const regexp = new RegExp(
-  Object.keys(process.env)
-    .filter(envVar => /token|password|credential|secret|private/i.test(envVar))
-    .map(envVar => escapeRegExp(process.env[envVar]))
-    .join('|'),
-  'g'
-);
+const toReplace = Object.keys(process.env).filter(envVar => /token|password|credential|secret|private/i.test(envVar));
+const regexp = new RegExp(toReplace.map(envVar => escapeRegExp(process.env[envVar])).join('|'), 'g');
 
-module.exports = output => output.replace(regexp, '[secure]');
+module.exports = output => {
+  return output && toReplace.length > 0 ? output.toString().replace(regexp, '[secure]') : output;
+};


Test patch:
diff --git a/test/hide-sensitive.test.js b/test/hide-sensitive.test.js
index 7a8fd55..815f867 100644
--- a/test/hide-sensitive.test.js
+++ b/test/hide-sensitive.test.js
@@ -32,3 +32,11 @@ test.serial('Escape regexp special characters', t => {
     'https://user:[secure]@host.com'
   );
 });
+
+test.serial('Accept "undefined" input', t => {
+  t.is(require('../lib/hide-sensitive')(), undefined);
+});
+
+test.serial('Return same string if no environment variable has to be replaced', t => {
+  t.is(require('../lib/hide-sensitive')('test'), 'test');
+});
Repository: semantic-release/semantic-release
Pull request #785 (2018-05-08 04:13:28)

fix: correct `git merge-base` error code handling
Cherry picked commit from #725 and added missing test.

Fix #725


Patch:
diff --git a/lib/git.js b/lib/git.js
index ad6b4b3..474af2e 100644
--- a/lib/git.js
+++ b/lib/git.js
@@ -36,9 +36,15 @@ async function gitTags() {
  */
 async function isRefInHistory(ref) {
   try {
-    return (await execa('git', ['merge-base', '--is-ancestor', ref, 'HEAD'])).code === 0;
+    await execa('git', ['merge-base', '--is-ancestor', ref, 'HEAD']);
+    return true;
   } catch (err) {
+    if (err.code === 1) {
+      return false;
+    }
+
     debug(err);
+    throw err;
   }
 }
 


Test patch:
diff --git a/test/git.test.js b/test/git.test.js
index 5ca650f..849914d 100644
--- a/test/git.test.js
+++ b/test/git.test.js
@@ -91,6 +91,7 @@ test.serial('Verify if the commit `sha` is in the direct history of the current
 
   t.true(await isRefInHistory(commits[0].hash));
   t.falsy(await isRefInHistory(otherCommits[0].hash));
+  await t.throws(isRefInHistory('non-existant-sha'));
 });
 
 test.serial('Get the commit sha for a given tag or falsy if the tag does not exists', async t => {
Repository: semantic-release/semantic-release
Pull request #826 (2018-06-19 18:55:52)

feat: allow to disable the publish plugin hook
This change allow to disable the `publish` hook (or to configure no plugins for that step).

The rational behind checking a plugin is set for the `publish` step was that there is no reason to run semantic-release at all if nothing get published.
However a lot of thing change since then and we now have the `prepare` step and the core is now creating the git tag.

So there might be situation where a user want to only create a tag, and maybe create a commit with the `@semantic-release/git` plugin during the `prepare` step. In such situation nothing should happen in the `publish` step (no npm release, no github release etc...), therefore it make senses to disable it. 


Patch:
diff --git a/lib/definitions/plugins.js b/lib/definitions/plugins.js
index 6f97b71..2fdf337 100644
--- a/lib/definitions/plugins.js
+++ b/lib/definitions/plugins.js
@@ -45,7 +45,7 @@ module.exports = {
   publish: {
     default: ['@semantic-release/npm', '@semantic-release/github'],
     config: {
-      validator: conf => Boolean(conf) && (isArray(conf) ? conf : [conf]).every(conf => validatePluginConfig(conf)),
+      validator: conf => !conf || (isArray(conf) ? conf : [conf]).every(conf => validatePluginConfig(conf)),
     },
     output: {
       validator: output => !output || isPlainObject(output),


Test patch:
diff --git a/test/definitions/plugins.test.js b/test/definitions/plugins.test.js
index 744c8a4..f016c59 100644
--- a/test/definitions/plugins.test.js
+++ b/test/definitions/plugins.test.js
@@ -60,9 +60,9 @@ test('The "prepare" plugin, if defined, must be a single or an array of plugins
 test('The "publish" plugin is mandatory, and must be a single or an array of plugins definition', t => {
   t.false(plugins.publish.config.validator({}));
   t.false(plugins.publish.config.validator({path: null}));
-  t.false(plugins.publish.config.validator());
 
   t.true(plugins.publish.config.validator({path: 'plugin-path.js'}));
+  t.true(plugins.publish.config.validator());
   t.true(plugins.publish.config.validator('plugin-path.js'));
   t.true(plugins.publish.config.validator(() => {}));
   t.true(plugins.publish.config.validator([{path: 'plugin-path.js'}, 'plugin-path.js', () => {}]));
Repository: semantic-release/semantic-release
Pull request #854 (2018-07-10 19:43:43)

fix: set default path to `generateNotes` object config


Patch:
diff --git a/lib/plugins/index.js b/lib/plugins/index.js
index 7c482b1..de61466 100644
--- a/lib/plugins/index.js
+++ b/lib/plugins/index.js
@@ -17,9 +17,10 @@ module.exports = (options, pluginsPath, logger) => {
       if (isUndefined(options[type])) {
         pluginConfs = def;
       } else {
+        const defaultPaths = castArray(def);
         // If an object is passed and the path is missing, set the default one for single plugins
-        if (isPlainObject(options[type]) && !options[type].path && castArray(def).length === 1) {
-          options[type].path = def;
+        if (isPlainObject(options[type]) && !options[type].path && defaultPaths.length === 1) {
+          [options[type].path] = defaultPaths;
         }
         if (configValidator && !configValidator(options[type])) {
           errors.push(getError('EPLUGINCONF', {type, pluginConf: options[type]}));


Test patch:
diff --git a/test/plugins/plugins.test.js b/test/plugins/plugins.test.js
index 945da15..2a3501d 100644
--- a/test/plugins/plugins.test.js
+++ b/test/plugins/plugins.test.js
@@ -117,13 +117,15 @@ test.serial('Export plugins loaded from the dependency of a shareable config fil
 
 test('Use default when only options are passed for a single plugin', t => {
   const analyzeCommits = {};
+  const generateNotes = {};
   const success = () => {};
   const fail = [() => {}];
 
-  const plugins = getPlugins({analyzeCommits, success, fail}, {}, t.context.logger);
+  const plugins = getPlugins({analyzeCommits, generateNotes, success, fail}, {}, t.context.logger);
 
   // Verify the module returns a function for each plugin
   t.is(typeof plugins.analyzeCommits, 'function');
+  t.is(typeof plugins.generateNotes, 'function');
   t.is(typeof plugins.success, 'function');
   t.is(typeof plugins.fail, 'function');
Repository: semantic-release/semantic-release
Pull request #877 (2018-07-30 17:58:52)

fix: also hide sensitive info when loggin from `cli.js`


Patch:
diff --git a/cli.js b/cli.js
index 42ed268..8bd89f0 100755
--- a/cli.js
+++ b/cli.js
@@ -1,4 +1,6 @@
-const {argv} = require('process');
+const {argv, env, stderr} = require('process');
+const util = require('util');
+const hideSensitive = require('./lib/hide-sensitive');
 
 const stringList = {
   type: 'string',
@@ -57,7 +59,7 @@ Usage:
     return 0;
   } catch (err) {
     if (err.name !== 'YError') {
-      console.error(err);
+      stderr.write(hideSensitive(env)(util.inspect(err, {colors: true})));
     }
     return 1;
   }
diff --git a/lib/hide-sensitive.js b/lib/hide-sensitive.js
index e457add..bb70d86 100644
--- a/lib/hide-sensitive.js
+++ b/lib/hide-sensitive.js
@@ -7,7 +7,5 @@ module.exports = env => {
   );
 
   const regexp = new RegExp(toReplace.map(envVar => escapeRegExp(env[envVar])).join('|'), 'g');
-  return output => {
-    return output && toReplace.length > 0 ? output.toString().replace(regexp, SECRET_REPLACEMENT) : output;
-  };
+  return output => (output && toReplace.length > 0 ? output.toString().replace(regexp, SECRET_REPLACEMENT) : output);
 };


Test patch:
diff --git a/test/cli.test.js b/test/cli.test.js
index 5aaab71..2b1a291 100644
--- a/test/cli.test.js
+++ b/test/cli.test.js
@@ -1,6 +1,8 @@
 import test from 'ava';
+import {escapeRegExp} from 'lodash';
 import proxyquire from 'proxyquire';
 import {stub} from 'sinon';
+import {SECRET_REPLACEMENT} from '../lib/definitions/constants';
 
 const requireNoCache = proxyquire.noPreserveCache();
 
@@ -208,3 +210,15 @@ test.serial('Return error code if semantic-release throw error', async t => {
   t.regex(t.context.errors, /semantic-release error/);
   t.is(exitCode, 1);
 });
+
+test.serial('Hide sensitive environment variable values from the logs', async t => {
+  const env = {MY_TOKEN: 'secret token'};
+  const run = stub().rejects(new Error(`Throw error: Exposing token ${env.MY_TOKEN}`));
+  const argv = ['', ''];
+  const cli = requireNoCache('../cli', {'.': run, process: {...process, argv, env: {...process.env, ...env}}});
+
+  const exitCode = await cli();
+
+  t.regex(t.context.errors, new RegExp(`Throw error: Exposing token ${escapeRegExp(SECRET_REPLACEMENT)}`));
+  t.is(exitCode, 1);
+});
Repository: semantic-release/semantic-release
Pull request #1007 (2018-11-30 01:01:01)

fix: remove unnecessary `branch` parameter from `push` function


Patch:
diff --git a/index.js b/index.js
index 0bbfa08..8a77527 100644
--- a/index.js
+++ b/index.js
@@ -107,7 +107,7 @@ async function run(context, plugins) {
   } else {
     // Create the tag before calling the publish plugins as some require the tag to exists
     await tag(nextRelease.gitTag, {cwd, env});
-    await push(options.repositoryUrl, options.branch, {cwd, env});
+    await push(options.repositoryUrl, {cwd, env});
     logger.success(`Created tag ${nextRelease.gitTag}`);
   }
 
diff --git a/lib/git.js b/lib/git.js
index be0cdaa..9aa6588 100644
--- a/lib/git.js
+++ b/lib/git.js
@@ -143,12 +143,11 @@ async function tag(tagName, execaOpts) {
  * Push to the remote repository.
  *
  * @param {String} repositoryUrl The remote repository URL.
- * @param {String} branch The branch to push.
  * @param {Object} [execaOpts] Options to pass to `execa`.
  *
  * @throws {Error} if the push failed.
  */
-async function push(repositoryUrl, branch, execaOpts) {
+async function push(repositoryUrl, execaOpts) {
   await execa('git', ['push', '--tags', repositoryUrl], execaOpts);
 }
 


Test patch:
diff --git a/test/git.test.js b/test/git.test.js
index 82d4b0b..661e4ef 100644
--- a/test/git.test.js
+++ b/test/git.test.js
@@ -157,7 +157,7 @@ test('Push tag to remote repository', async t => {
   const commits = await gitCommits(['Test commit'], {cwd});
 
   await tag('tag_name', {cwd});
-  await push(repositoryUrl, 'master', {cwd});
+  await push(repositoryUrl, {cwd});
 
   t.is(await gitRemoteTagHead(repositoryUrl, 'tag_name', {cwd}), commits[0].hash);
 });
@@ -171,7 +171,7 @@ test('Push tag to remote repository with remote branch ahaed', async t => {
   await gitPush('origin', 'master', {cwd: tmpRepo});
 
   await tag('tag_name', {cwd});
-  await push(repositoryUrl, 'master', {cwd});
+  await push(repositoryUrl, {cwd});
 
   t.is(await gitRemoteTagHead(repositoryUrl, 'tag_name', {cwd}), commits[0].hash);
 });