Added back the token in a usable way
This commit is contained in:
@@ -12,6 +12,10 @@ inputs:
|
||||
description: "The main branch to rebase on"
|
||||
default: "dev"
|
||||
required: false
|
||||
ciToken:
|
||||
description: Token to use
|
||||
default: "${{ secrets.CI_TOKEN }}"
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: 'node20'
|
||||
|
||||
8
app.ts
8
app.ts
@@ -8,7 +8,9 @@ const IGNORED_BRANCHES: string[] = core.getInput('branchesToIgnore', { required:
|
||||
|
||||
const mainBranch: string = `origin/${ core.getInput('mainBranch', { required: false }) }`;
|
||||
|
||||
const { CI_TOKEN, GITHUB_SERVER_URL } = process.env;
|
||||
const CI_TOKEN: string = core.getInput('ciToken', { required: false, trimWhitespace: true });
|
||||
|
||||
const { GITHUB_SERVER_URL } = process.env;
|
||||
|
||||
enum Action {
|
||||
Rebase = 0,
|
||||
@@ -214,7 +216,7 @@ const setupCIToken = async () => {
|
||||
"origin"
|
||||
]);
|
||||
|
||||
const httpLessUrl = remoteUrl.replace(/https?:\/\//, "");
|
||||
const httpLessUrl = remoteUrl.trim().replace(/https?:\/\//, "");
|
||||
const newUrl = `https://MilaBot:${ CI_TOKEN }@${ httpLessUrl }.git`;
|
||||
|
||||
await runGitCommand([
|
||||
@@ -228,7 +230,7 @@ const setupCIToken = async () => {
|
||||
"config",
|
||||
"--local",
|
||||
"--unset",
|
||||
`http.https://${ GITHUB_SERVER_URL }/.extraheader`
|
||||
`http.https://${ GITHUB_SERVER_URL.replace(/https?:\/\//, "") }/.extraheader`
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
2
dist/app.js
vendored
2
dist/app.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user