fix: splitting tokens
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import got from 'got';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
const GITHUB_TOKEN = core.getInput('github-token', { required: true });
|
||||
const GITHUB_TOKEN = core.getInput('api-token', { required: true });
|
||||
|
||||
export default got.extend({
|
||||
headers: {
|
||||
|
@@ -5,13 +5,9 @@ import * as exec from '@actions/exec';
|
||||
|
||||
const { GITHUB_REPOSITORY, GITHUB_REF } = process.env;
|
||||
|
||||
const IS_TEST = process.env.NODE_ENV === 'test';
|
||||
|
||||
const branch = GITHUB_REF?.replace('refs/heads/', '');
|
||||
|
||||
export default new (class Git {
|
||||
commandsRun: string[] = [];
|
||||
|
||||
constructor() {
|
||||
const githubToken = core.getInput('github-token', { required: true });
|
||||
core.setSecret(githubToken);
|
||||
@@ -76,8 +72,6 @@ export default new (class Git {
|
||||
push = () => this.exec(`push origin ${branch} --follow-tags`);
|
||||
|
||||
isShallow = async () => {
|
||||
if (IS_TEST) return false;
|
||||
|
||||
const isShallow: string = await this.exec(
|
||||
'rev-parse --is-shallow-repository'
|
||||
);
|
||||
|
@@ -119,7 +119,7 @@ export async function run(): Promise<any> {
|
||||
await main();
|
||||
process.exit(0);
|
||||
} catch (error) {
|
||||
core.error('#catchAll:');
|
||||
core.error('#run:');
|
||||
core.error(error);
|
||||
process.exit(1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user