mirror of
https://github.com/pre-commit/action.git
synced 2025-11-09 03:26:56 +00:00
Add inputs for user name and email
This commit is contained in:
parent
db6d0e3ee6
commit
c622e65318
1 changed files with 4 additions and 2 deletions
6
index.js
6
index.js
|
|
@ -45,6 +45,8 @@ async function main() {
|
||||||
...tr.argStringToArray(core.getInput('extra_args')),
|
...tr.argStringToArray(core.getInput('extra_args')),
|
||||||
];
|
];
|
||||||
const token = core.getInput('token');
|
const token = core.getInput('token');
|
||||||
|
const git_user_name = core.getInput('git_user_name');
|
||||||
|
const git_user_email = core.getInput('git_user_email');
|
||||||
const pr = github.context.payload.pull_request;
|
const pr = github.context.payload.pull_request;
|
||||||
const push = !!token && !!pr;
|
const push = !!token && !!pr;
|
||||||
|
|
||||||
|
|
@ -81,9 +83,9 @@ async function main() {
|
||||||
);
|
);
|
||||||
if (diff) {
|
if (diff) {
|
||||||
await core.group('push fixes', async () => {
|
await core.group('push fixes', async () => {
|
||||||
await exec.exec('git', ['config', 'user.name', 'pre-commit']);
|
await exec.exec('git', ['config', 'user.name', git_user_name]);
|
||||||
await exec.exec(
|
await exec.exec(
|
||||||
'git', ['config', 'user.email', 'pre-commit@example.com']
|
'git', ['config', 'user.email', git_user_email]
|
||||||
);
|
);
|
||||||
|
|
||||||
const branch = pr.head.ref;
|
const branch = pr.head.ref;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue