Updating action for git checkout v6

This commit is contained in:
2026-01-18 12:28:46 +01:00
parent a58e064f7c
commit 41d5bd5571
4 changed files with 37 additions and 64 deletions

29
app.ts
View File

@@ -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);
}