mirror of
https://github.com/crazy-max/ghaction-import-gpg.git
synced 2024-12-01 09:21:03 -05:00
19 lines
518 B
TypeScript
19 lines
518 B
TypeScript
|
import * as exec from './exec';
|
||
|
|
||
|
const git = async (args: string[] = []): Promise<string> => {
|
||
|
return await exec.exec(`git`, args, true).then(res => {
|
||
|
if (res.stderr != '' && !res.success) {
|
||
|
throw new Error(res.stderr);
|
||
|
}
|
||
|
return res.stdout.trim();
|
||
|
});
|
||
|
};
|
||
|
|
||
|
export async function enableCommitGpgsign(): Promise<void> {
|
||
|
await git(['config', 'commit.gpgsign', 'true']);
|
||
|
}
|
||
|
|
||
|
export async function setUserSigningkey(keyid: string): Promise<void> {
|
||
|
await git(['config', 'user.signingkey', keyid]);
|
||
|
}
|