Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(git): add support for git url aliases #633

Merged
merged 1 commit into from
Mar 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/plugin/GitBase.js
Expand Up @@ -55,7 +55,7 @@ class GitBase extends Plugin {
async getRemoteUrl() {
const remoteNameOrUrl = this.options.pushRepo || (await this.getRemote()) || 'origin';
return this.isRemoteName(remoteNameOrUrl)
? this.exec(`git config --get remote.${remoteNameOrUrl}.url`, { options }).catch(() => null)
? this.exec(`git remote get-url ${remoteNameOrUrl}`, { options }).catch(() => null)
: remoteNameOrUrl;
}

Expand Down
2 changes: 1 addition & 1 deletion test/github.js
Expand Up @@ -66,7 +66,7 @@ test('should release and upload assets', async t => {
test('should release to enterprise host', async t => {
const github = factory(GitHub, { options: { github: { tokenRef } } });
const exec = sinon.stub(github.shell, 'exec').callThrough();
exec.withArgs('git config --get remote.origin.url').resolves(`https://github.example.org/user/repo`);
exec.withArgs('git remote get-url origin').resolves(`https://github.example.org/user/repo`);
exec.withArgs('git describe --tags --abbrev=0').resolves(`1.0.0`);

const remote = { api: 'https://github.example.org/api/v3', host: 'github.example.org' };
Expand Down