fix: remove unnecessary branch
parameter from push
function
This commit is contained in:
parent
b729183b4a
commit
968b9968a1
4
index.js
4
index.js
@ -108,7 +108,7 @@ async function run(context, plugins) {
|
|||||||
|
|
||||||
logger.log('Create tag %s', nextRelease.gitTag);
|
logger.log('Create tag %s', nextRelease.gitTag);
|
||||||
await tag(nextRelease.gitTag, nextRelease.gitHead, {cwd, env});
|
await tag(nextRelease.gitTag, nextRelease.gitHead, {cwd, env});
|
||||||
await push(options.repositoryUrl, context.branch.name, {cwd, env});
|
await push(options.repositoryUrl, {cwd, env});
|
||||||
context.branch.tags.push({
|
context.branch.tags.push({
|
||||||
version: nextRelease.version,
|
version: nextRelease.version,
|
||||||
channel: nextRelease.channel,
|
channel: nextRelease.channel,
|
||||||
@ -164,7 +164,7 @@ async function run(context, plugins) {
|
|||||||
} else {
|
} else {
|
||||||
// Create the tag before calling the publish plugins as some require the tag to exists
|
// Create the tag before calling the publish plugins as some require the tag to exists
|
||||||
await tag(nextRelease.gitTag, nextRelease.gitHead, {cwd, env});
|
await tag(nextRelease.gitTag, nextRelease.gitHead, {cwd, env});
|
||||||
await push(options.repositoryUrl, context.branch.name, {cwd, env});
|
await push(options.repositoryUrl, {cwd, env});
|
||||||
logger.success(`Created tag ${nextRelease.gitTag}`);
|
logger.success(`Created tag ${nextRelease.gitTag}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,12 +229,11 @@ async function tag(tagName, ref, execaOpts) {
|
|||||||
* Push to the remote repository.
|
* Push to the remote repository.
|
||||||
*
|
*
|
||||||
* @param {String} repositoryUrl The remote repository URL.
|
* @param {String} repositoryUrl The remote repository URL.
|
||||||
* @param {String} branch The branch to push.
|
|
||||||
* @param {Object} [execaOpts] Options to pass to `execa`.
|
* @param {Object} [execaOpts] Options to pass to `execa`.
|
||||||
*
|
*
|
||||||
* @throws {Error} if the push failed.
|
* @throws {Error} if the push failed.
|
||||||
*/
|
*/
|
||||||
async function push(repositoryUrl, branch, execaOpts) {
|
async function push(repositoryUrl, execaOpts) {
|
||||||
await execa('git', ['push', '--tags', repositoryUrl], execaOpts);
|
await execa('git', ['push', '--tags', repositoryUrl], execaOpts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ test('Push tag to remote repository', async t => {
|
|||||||
const commits = await gitCommits(['Test commit'], {cwd});
|
const commits = await gitCommits(['Test commit'], {cwd});
|
||||||
|
|
||||||
await tag('tag_name', 'HEAD', {cwd});
|
await tag('tag_name', 'HEAD', {cwd});
|
||||||
await push(repositoryUrl, 'master', {cwd});
|
await push(repositoryUrl, {cwd});
|
||||||
|
|
||||||
t.is(await gitRemoteTagHead(repositoryUrl, 'tag_name', {cwd}), commits[0].hash);
|
t.is(await gitRemoteTagHead(repositoryUrl, 'tag_name', {cwd}), commits[0].hash);
|
||||||
});
|
});
|
||||||
@ -208,7 +208,7 @@ test('Push tag to remote repository with remote branch ahead', async t => {
|
|||||||
await gitPush('origin', 'master', {cwd: tmpRepo});
|
await gitPush('origin', 'master', {cwd: tmpRepo});
|
||||||
|
|
||||||
await tag('tag_name', 'HEAD', {cwd});
|
await tag('tag_name', 'HEAD', {cwd});
|
||||||
await push(repositoryUrl, 'master', {cwd});
|
await push(repositoryUrl, {cwd});
|
||||||
|
|
||||||
t.is(await gitRemoteTagHead(repositoryUrl, 'tag_name', {cwd}), commits[0].hash);
|
t.is(await gitRemoteTagHead(repositoryUrl, 'tag_name', {cwd}), commits[0].hash);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user