mirror of
https://github.com/crazy-max/ghaction-import-gpg.git
synced 2024-12-24 12:12:08 -05:00
Add workdir input (#55)
This commit is contained in:
parent
7b5f85f38b
commit
d2c8669ec3
4 changed files with 18 additions and 1 deletions
|
@ -5,7 +5,7 @@
|
|||
[![Become a sponsor](https://img.shields.io/badge/sponsor-crazy--max-181717.svg?logo=github&style=flat-square)](https://github.com/sponsors/crazy-max)
|
||||
[![Paypal Donate](https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=flat-square)](https://www.paypal.me/crazyws)
|
||||
|
||||
## About
|
||||
## About <!-- omit in toc -->
|
||||
|
||||
GitHub Action to easily import a GPG key.
|
||||
|
||||
|
@ -22,6 +22,7 @@ ___
|
|||
* [Sign commits](#sign-commits)
|
||||
* [Customizing](#customizing)
|
||||
* [inputs](#inputs)
|
||||
* [outputs](#outputs)
|
||||
* [environment variables](#environment-variables)
|
||||
* [Keep up-to-date with GitHub Dependabot](#keep-up-to-date-with-github-dependabot)
|
||||
* [How can I help?](#how-can-i-help)
|
||||
|
@ -137,6 +138,7 @@ Following inputs can be used as `step.with` keys
|
|||
| `git_push_gpgsign`**¹** | Bool | Sign all pushes automatically. (default `false`) |
|
||||
| `git_committer_name`**¹** | String | Set commit author's name (defaults to the name associated with the GPG key) |
|
||||
| `git_committer_email`**¹** | String | Set commit author's email (defaults to the email address associated with the GPG key) |
|
||||
| `workdir` | String | Working directory (below repository root) |
|
||||
|
||||
> **¹** `git_user_signingkey` needs to be enabled for these inputs to be used.
|
||||
|
||||
|
|
|
@ -29,6 +29,10 @@ inputs:
|
|||
git_committer_email:
|
||||
description: 'Commit author''s email'
|
||||
required: false
|
||||
workdir:
|
||||
description: 'Working directory (below repository root)'
|
||||
default: '.'
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
fingerprint:
|
||||
|
|
5
dist/index.js
generated
vendored
5
dist/index.js
generated
vendored
|
@ -295,6 +295,11 @@ function run() {
|
|||
const git_push_gpgsign = /true/i.test(core.getInput('git_push_gpgsign'));
|
||||
const git_committer_name = core.getInput('git_committer_name');
|
||||
const git_committer_email = core.getInput('git_committer_email');
|
||||
const workdir = core.getInput('workdir') || '.';
|
||||
if (workdir && workdir !== '.') {
|
||||
core.info(`📂 Using ${workdir} as working directory...`);
|
||||
process.chdir(workdir);
|
||||
}
|
||||
core.info('📣 GnuPG info');
|
||||
const version = yield gpg.getVersion();
|
||||
const dirs = yield gpg.getDirs();
|
||||
|
|
|
@ -17,6 +17,12 @@ async function run(): Promise<void> {
|
|||
const git_push_gpgsign = /true/i.test(core.getInput('git_push_gpgsign'));
|
||||
const git_committer_name: string = core.getInput('git_committer_name');
|
||||
const git_committer_email: string = core.getInput('git_committer_email');
|
||||
const workdir: string = core.getInput('workdir') || '.';
|
||||
|
||||
if (workdir && workdir !== '.') {
|
||||
core.info(`📂 Using ${workdir} as working directory...`);
|
||||
process.chdir(workdir);
|
||||
}
|
||||
|
||||
core.info('📣 GnuPG info');
|
||||
const version = await gpg.getVersion();
|
||||
|
|
Loading…
Reference in a new issue