Updating action for git checkout v6
This commit is contained in:
29
app.ts
29
app.ts
@@ -217,36 +217,9 @@ const rebaseBranch = async (rebaseAction: RebaseAction): Promise<RebaseAction &
|
||||
return { ...rebaseAction, success: doneWithSuccess };
|
||||
}
|
||||
|
||||
const setupCIToken = async () => {
|
||||
writeConsole("Overriding git repository auth with CI_TOKEN")
|
||||
|
||||
const remoteUrl = await runGitCommand([
|
||||
"remote",
|
||||
"get-url",
|
||||
"origin"
|
||||
]);
|
||||
|
||||
const httpLessUrl = remoteUrl.trim().replace(/https?:\/\//, "");
|
||||
const newUrl = `https://MilaBot:${ CI_TOKEN }@${ httpLessUrl }.git`;
|
||||
|
||||
await runGitCommand([
|
||||
"remote",
|
||||
"set-url",
|
||||
"origin",
|
||||
newUrl
|
||||
]);
|
||||
|
||||
await runGitCommand([
|
||||
"config",
|
||||
"--local",
|
||||
"--unset",
|
||||
`http.https://${ GITHUB_SERVER_URL.replace(/https?:\/\//, "") }/.extraheader`
|
||||
]);
|
||||
}
|
||||
|
||||
const setupAutoRebaseGit = async () => {
|
||||
if (CI_TOKEN) {
|
||||
await setupCIToken();
|
||||
writeConsole("Found CI_TOKEN, don't forget to set it up in the checkout")
|
||||
} else {
|
||||
writeConsole("Couldn't find a CI_TOKEN. Using the gitea ghost.", LogLevel.WARNING);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user