Skip to content

Commit

Permalink
Do not assume remote name is origin in remark-lint:awesome-github (
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall authored Sep 21, 2023
1 parent 5b14297 commit c94b1c6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion rules/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,22 @@ module.exports = rule('remark-lint:awesome-github', async (ast, file) => {
const {dirname} = file;

try {
const gitBranch = await execa.stdout('git', [
'branch',
'--show-current'
]);

const remoteName = await execa.stdout('git', [
'config',
'--get',
`branch.${gitBranch}.remote`
]);

const remoteUrl = await execa.stdout('git', [
'remote',
'get-url',
'--push',
'origin'
remoteName
], {
cwd: dirname
});
Expand Down

0 comments on commit c94b1c6

Please sign in to comment.