Skip to content

Commit

Permalink
Use clone URL provided from the payload to support GHES (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZauberNerd authored Jun 29, 2022
1 parent 73b72b8 commit b1bb2aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backport",
"version": "2.0.2",
"version": "2.0.3",
"license": "MIT",
"main": "dist/index.js",
"files": [
Expand Down
9 changes: 5 additions & 4 deletions src/backport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,11 @@ const backport = async ({

info(`Backporting ${mergeCommitSha} from #${number}.`);

await exec("git", [
"clone",
`https://x-access-token:${token}@github.com/${owner}/${repo}.git`,
]);
const cloneUrl = new URL(payload.repository.clone_url);
cloneUrl.username = "x-access-token";
cloneUrl.password = token;

await exec("git", ["clone", cloneUrl.toString()]);
await exec("git", [
"config",
"--global",
Expand Down

0 comments on commit b1bb2aa

Please sign in to comment.