mirror of
https://code.forgejo.org/actions/git-backporting
synced 2025-07-01 23:06:00 +02:00
feat(gh-85): take git tokens from environment (#88)
This commit is contained in:
parent
aac73bf7c5
commit
70da575afc
17 changed files with 456 additions and 24 deletions
|
@ -1,4 +1,5 @@
|
|||
import * as core from "@actions/core";
|
||||
import { AuthTokenId } from "@bp/service/configs/configs.types";
|
||||
import * as fs from "fs";
|
||||
|
||||
export const addProcessArgs = (args: string[]) => {
|
||||
|
@ -9,6 +10,13 @@ export const resetProcessArgs = () => {
|
|||
process.argv = ["node", "backporting"];
|
||||
};
|
||||
|
||||
export const resetEnvTokens = () => {
|
||||
delete process.env[AuthTokenId.GITHUB_TOKEN];
|
||||
delete process.env[AuthTokenId.GITLAB_TOKEN];
|
||||
delete process.env[AuthTokenId.CODEBERG_TOKEN];
|
||||
delete process.env[AuthTokenId.GIT_TOKEN];
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export const spyGetInput = (obj: any) => {
|
||||
const mock = jest.spyOn(core, "getInput");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue