Kubernetes use env var based secrets

pull/310/head
Frostebite 2021-12-29 22:08:32 +00:00
parent 0edbe4e96c
commit 03cb26f073
5 changed files with 19 additions and 13 deletions

15
dist/index.js vendored
View File

@ -3502,13 +3502,16 @@ class GitRepoReader {
} }
static GetRemote() { static GetRemote() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
return (yield system_1.default.run(`git remote -v`)).split(' ')[1].split('https://github.com/')[1].split('.git')[0]; return (yield system_1.default.run(`git remote -v`, [], {}, false))
.split(' ')[1]
.split('https://github.com/')[1]
.split('.git')[0];
}); });
} }
static GetBranch() { static GetBranch() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
console_1.assert(fs_1.default.existsSync(`.git`)); console_1.assert(fs_1.default.existsSync(`.git`));
return (yield system_1.default.run(`git branch`)).split('*')[1].split(`\n`)[0].replace(/ /g, ``); return (yield system_1.default.run(`git branch`, [], {}, false)).split('*')[1].split(`\n`)[0].replace(/ /g, ``);
}); });
} }
} }
@ -3542,8 +3545,8 @@ class GithubCliReader {
static GetGitHubAuthToken() { static GetGitHubAuthToken() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
try { try {
assert_1.default(yield system_1.default.run(`gh --help`)); assert_1.default(yield system_1.default.run(`gh --help`, [], {}, false));
return yield system_1.default.run(`gh auth status -t`); return yield system_1.default.run(`gh auth status -t`, [], {}, false);
} }
catch (_a) { catch (_a) {
return ''; return '';
@ -3917,7 +3920,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__webpack_require__(42186)); const core = __importStar(__webpack_require__(42186));
const exec_1 = __webpack_require__(71514); const exec_1 = __webpack_require__(71514);
class System { class System {
static run(command, arguments_ = [], options = {}) { static run(command, arguments_ = [], options = {}, shouldDebug = true) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let result = ''; let result = '';
let error = ''; let error = '';
@ -3934,7 +3937,7 @@ class System {
}, },
}; };
const showOutput = () => { const showOutput = () => {
if (debug !== '') { if (debug !== '' && shouldDebug) {
core.debug(debug); core.debug(debug);
} }
if (result !== '') { if (result !== '') {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -7,10 +7,13 @@ export class GitRepoReader {
return ''; return '';
} }
public static async GetRemote() { public static async GetRemote() {
return (await System.run(`git remote -v`)).split(' ')[1].split('https://github.com/')[1].split('.git')[0]; return (await System.run(`git remote -v`, [], {}, false))
.split(' ')[1]
.split('https://github.com/')[1]
.split('.git')[0];
} }
public static async GetBranch() { public static async GetBranch() {
assert(fs.existsSync(`.git`)); assert(fs.existsSync(`.git`));
return (await System.run(`git branch`)).split('*')[1].split(`\n`)[0].replace(/ /g, ``); return (await System.run(`git branch`, [], {}, false)).split('*')[1].split(`\n`)[0].replace(/ /g, ``);
} }
} }

View File

@ -4,8 +4,8 @@ import System from '../system';
export class GithubCliReader { export class GithubCliReader {
static async GetGitHubAuthToken() { static async GetGitHubAuthToken() {
try { try {
assert(await System.run(`gh --help`)); assert(await System.run(`gh --help`, [], {}, false));
return await System.run(`gh auth status -t`); return await System.run(`gh auth status -t`, [], {}, false);
} catch { } catch {
return ''; return '';
} }

View File

@ -2,7 +2,7 @@ import * as core from '@actions/core';
import { exec } from '@actions/exec'; import { exec } from '@actions/exec';
class System { class System {
static async run(command, arguments_: any = [], options = {}) { static async run(command, arguments_: any = [], options = {}, shouldDebug = true) {
let result = ''; let result = '';
let error = ''; let error = '';
let debug = ''; let debug = '';
@ -20,7 +20,7 @@ class System {
}; };
const showOutput = () => { const showOutput = () => {
if (debug !== '') { if (debug !== '' && shouldDebug) {
core.debug(debug); core.debug(debug);
} }