Updating action for git checkout v6
This commit is contained in:
@@ -18,5 +18,5 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node24'
|
||||||
main: 'dist/app.js'
|
main: 'dist/app.js'
|
||||||
|
|||||||
29
app.ts
29
app.ts
@@ -217,36 +217,9 @@ const rebaseBranch = async (rebaseAction: RebaseAction): Promise<RebaseAction &
|
|||||||
return { ...rebaseAction, success: doneWithSuccess };
|
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 () => {
|
const setupAutoRebaseGit = async () => {
|
||||||
if (CI_TOKEN) {
|
if (CI_TOKEN) {
|
||||||
await setupCIToken();
|
writeConsole("Found CI_TOKEN, don't forget to set it up in the checkout")
|
||||||
} else {
|
} else {
|
||||||
writeConsole("Couldn't find a CI_TOKEN. Using the gitea ghost.", LogLevel.WARNING);
|
writeConsole("Couldn't find a CI_TOKEN. Using the gitea ghost.", LogLevel.WARNING);
|
||||||
}
|
}
|
||||||
|
|||||||
68
dist/app.js
vendored
68
dist/app.js
vendored
File diff suppressed because one or more lines are too long
@@ -6,7 +6,7 @@
|
|||||||
"strict": false,
|
"strict": false,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"module": "esnext",
|
"module": "nodenext",
|
||||||
"moduleResolution": "nodenext",
|
"moduleResolution": "nodenext",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true
|
"isolatedModules": true
|
||||||
|
|||||||
Reference in New Issue
Block a user