mirror of
https://github.com/crazy-max/ghaction-import-gpg.git
synced 2024-12-26 21:12:12 -05:00
dd220e93c3
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
19 lines
492 B
TypeScript
19 lines
492 B
TypeScript
import * as exec from '@actions/exec';
|
|
|
|
const git = async (args: string[] = []): Promise<string> => {
|
|
return await exec
|
|
.getExecOutput(`git`, args, {
|
|
ignoreReturnCode: true,
|
|
silent: true
|
|
})
|
|
.then(res => {
|
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
|
throw new Error(res.stderr);
|
|
}
|
|
return res.stdout.trim();
|
|
});
|
|
};
|
|
|
|
export async function setConfig(key: string, value: string): Promise<void> {
|
|
await git(['config', key, value]);
|
|
}
|