import-gpg/src/context.ts
CrazyMax 106dc525b1
Move GPG_PRIVATE_KEY env var to gpg-private-key input
Move PASSPHRASE env var to passphrase input
Rename git_user_signingkey input to git-user-signingkey
Rename git_commit_gpgsign input to git-commit-gpgsign
Rename git_tag_gpgsign input to git-tag-gpgsign
Rename git_push_gpgsign input to git-push-gpgsign
Rename git_committer_name input to git-committer-name
Rename git_committer_email input to git-committer-email
2020-09-06 22:03:16 +02:00

27 lines
939 B
TypeScript

import * as core from '@actions/core';
export interface Inputs {
gpgPrivateKey: string;
passphrase: string;
gitUserSigningkey: boolean;
gitCommitGpgsign: boolean;
gitTagGpgsign: boolean;
gitPushGpgsign: boolean;
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: /true/i.test(core.getInput('git-push-gpgsign')),
gitCommitterName: core.getInput('git-committer-name'),
gitCommitterEmail: core.getInput('git-committer-name'),
workdir: core.getInput('workdir') || '.'
};
}