-
-
Notifications
You must be signed in to change notification settings - Fork 71
/
context.ts
33 lines (30 loc) · 1.13 KB
/
context.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import * as core from '@actions/core';
import {issueCommand} from '@actions/core/lib/command';
export interface Inputs {
gpgPrivateKey: string;
passphrase: string;
gitUserSigningkey: boolean;
gitCommitGpgsign: boolean;
gitTagGpgsign: boolean;
gitPushGpgsign: string;
gitCommitterName: string;
gitCommitterEmail: string;
workdir: string;
}
export async function getInputs(): Promise<Inputs> {
return {
gpgPrivateKey: core.getInput('gpg-private-key', {required: true}),
passphrase: core.getInput('passphrase'),
gitUserSigningkey: /true/i.test(core.getInput('git-user-signingkey')),
gitCommitGpgsign: /true/i.test(core.getInput('git-commit-gpgsign')),
gitTagGpgsign: /true/i.test(core.getInput('git-tag-gpgsign')),
gitPushGpgsign: core.getInput('git-push-gpgsign'),
gitCommitterName: core.getInput('git-committer-name'),
gitCommitterEmail: core.getInput('git-committer-email'),
workdir: core.getInput('workdir') || '.'
};
}
// FIXME: Temp fix https://github.com/actions/toolkit/issues/777
export function setOutput(name: string, value: any): void {
issueCommand('set-output', {name}, value);
}