Kubernetes use env var based secrets
parent
0edbe4e96c
commit
03cb26f073
|
|
@ -3502,13 +3502,16 @@ class GitRepoReader {
|
|||
}
|
||||
static GetRemote() {
|
||||
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() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
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() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
assert_1.default(yield system_1.default.run(`gh --help`));
|
||||
return yield system_1.default.run(`gh auth status -t`);
|
||||
assert_1.default(yield system_1.default.run(`gh --help`, [], {}, false));
|
||||
return yield system_1.default.run(`gh auth status -t`, [], {}, false);
|
||||
}
|
||||
catch (_a) {
|
||||
return '';
|
||||
|
|
@ -3917,7 +3920,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|||
const core = __importStar(__webpack_require__(42186));
|
||||
const exec_1 = __webpack_require__(71514);
|
||||
class System {
|
||||
static run(command, arguments_ = [], options = {}) {
|
||||
static run(command, arguments_ = [], options = {}, shouldDebug = true) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result = '';
|
||||
let error = '';
|
||||
|
|
@ -3934,7 +3937,7 @@ class System {
|
|||
},
|
||||
};
|
||||
const showOutput = () => {
|
||||
if (debug !== '') {
|
||||
if (debug !== '' && shouldDebug) {
|
||||
core.debug(debug);
|
||||
}
|
||||
if (result !== '') {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -7,10 +7,13 @@ export class GitRepoReader {
|
|||
return '';
|
||||
}
|
||||
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() {
|
||||
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, ``);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import System from '../system';
|
|||
export class GithubCliReader {
|
||||
static async GetGitHubAuthToken() {
|
||||
try {
|
||||
assert(await System.run(`gh --help`));
|
||||
return await System.run(`gh auth status -t`);
|
||||
assert(await System.run(`gh --help`, [], {}, false));
|
||||
return await System.run(`gh auth status -t`, [], {}, false);
|
||||
} catch {
|
||||
return '';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import * as core from '@actions/core';
|
|||
import { exec } from '@actions/exec';
|
||||
|
||||
class System {
|
||||
static async run(command, arguments_: any = [], options = {}) {
|
||||
static async run(command, arguments_: any = [], options = {}, shouldDebug = true) {
|
||||
let result = '';
|
||||
let error = '';
|
||||
let debug = '';
|
||||
|
|
@ -20,7 +20,7 @@ class System {
|
|||
};
|
||||
|
||||
const showOutput = () => {
|
||||
if (debug !== '') {
|
||||
if (debug !== '' && shouldDebug) {
|
||||
core.debug(debug);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue