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

View File

@@ -18,5 +18,5 @@ inputs:
required: false
runs:
using: 'node20'
using: 'node24'
main: 'dist/app.js'

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

68
dist/app.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -6,7 +6,7 @@
"strict": false,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"module": "nodenext",
"moduleResolution": "nodenext",
"resolveJsonModule": true,
"isolatedModules": true