Skip to content

Commit

Permalink
Update inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
kaskar2008 committed Mar 22, 2022
1 parent 10748d4 commit 7e2617a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
13 changes: 13 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
name: 'Auto bump version'
description: 'Bumps target branch version on PR merge'
inputs:
name:
description: 'Name to set git push author'
required: false
default: 'GitHub Actions Bot'
email:
description: 'Email to set git push author'
required: false
default: '[email protected]'
token:
description: 'Write token to the repository'
required: false
default: ''
outputs:
tag:
description: 'New tag'
Expand Down
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
const core = require('@actions/core');
const github = require('@actions/github');
const { exec } = require('child_process');
const { exec, execSync } = require('child_process');

try {
exec(`git config user.name "GitHub Actions Bot" && git config user.email "[email protected]"`, (err) => {
const inputs = {
name: core.getInput('name'),
email: core.getInput('email'),
token: core.getInput('token') || process.env.TOKEN,
};

exec(`git config user.name "${inputs.name}" && git config user.email "${inputs.email}"`, (err) => {
if (err) {
throw err;
}
Expand Down

0 comments on commit 7e2617a

Please sign in to comment.