Skip to content

Commit

Permalink
getPatch: use github ssh url
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed Nov 21, 2024
1 parent 87f2cce commit b350f9f
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/getPatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@ export default async function getPatch ({
} catch (err) {
console.log(err)

// since we failed to get the diff, we will try to get the PR body through cloning the source code
const { data: repoResponse } = await github.request('GET /repos/{owner}/{repo}', {
owner,
repo,
pull_number: prnum,
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
})

const { data: prResponse } = await github.request('GET /repos/{owner}/{repo}/pulls/{pull_number}', {
owner,
repo,
Expand All @@ -69,7 +59,7 @@ export default async function getPatch ({
})

// clone the repo
const cloneUrl = repoResponse.clone_url
const cloneUrl = `[email protected]:${owner}/${repo}.git`
const clonePath = path.join(os.tmpdir(), `pr-${prnum}`)

console.log(`Cloning ${cloneUrl} to ${clonePath}, manually`)
Expand Down

0 comments on commit b350f9f

Please sign in to comment.