Add commit_user_name and commit_user_email inputs

This commit is contained in:
Stefan Zweifel 2020-02-04 20:14:27 +01:00
parent 99f6ce74b4
commit d47024e59c
3 changed files with 14 additions and 2 deletions

View File

@ -29,6 +29,10 @@ Add the following step at the end of your job.
# Optional repository path
repository: .
# Optional commit user settings
commit_user_name: My GitHub Actions Bot
commit_user_email: my-github-actions-bot@example.org
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

View File

@ -21,6 +21,14 @@ inputs:
description: Path to git repository
required: false
default: '.'
commit_user_name:
description: Name used for the commit user
required: false
default: GitHub Actions
commit_user_email:
description: Email address used for the commit user
required: false
default: actions@github.com
runs:
using: 'docker'

View File

@ -44,8 +44,8 @@ _setup_git ( ) {
EOF
chmod 600 $HOME/.netrc
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git config --global user.name "$INPUT_COMMIT_USER_NAME"
git config --global user.email "$INPUT_COMMIT_USER_EMAIL"
}
_switch_to_branch() {