| 651 | } |
| 652 | |
| 653 | async function configureGit(appToken: string) { |
| 654 | // Do not change git config when running locally |
| 655 | if (isMock()) return |
| 656 | |
| 657 | console.log("Configuring git...") |
| 658 | const config = "http.https://github.com/.extraheader" |
| 659 | const ret = await $`git config --local --get ${config}` |
| 660 | gitConfig = ret.stdout.toString().trim() |
| 661 | |
| 662 | const newCredentials = Buffer.from(`x-access-token:${appToken}`, "utf8").toString("base64") |
| 663 | |
| 664 | await $`git config --local --unset-all ${config}` |
| 665 | await $`git config --local ${config} "AUTHORIZATION: basic ${newCredentials}"` |
| 666 | } |
| 667 | |
| 668 | async function assertGitIdentityConfigured() { |
| 669 | const name = (await $`git config --get user.name`.nothrow()).stdout.toString().trim() |