Skip to content

Commit

Permalink
feat: Add username and useremail options
Browse files Browse the repository at this point in the history
Close #66
  • Loading branch information
peaceiris committed Dec 24, 2019
1 parent d772f4e commit 0bdd00b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ inputs:
description: 'Keep only the latest commit on a GitHub Pages branch'
required: false
default: 'false'
username:
description: 'Set Git user.name'
required: false
useremail:
description: 'Set Git user.email'
required: false
12 changes: 10 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,16 @@ else
fi

# push to publishing branch
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
if [[ -n "${INPUT_USERNAME}" ]]; then
git config user.name "${INPUT_USERNAME}"
else
git config user.name "${GITHUB_ACTOR}"
fi
if [[ -n "${INPUT_USEREMAIL}" ]]; then
git config user.email "${INPUT_USEREMAIL}"
else
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
fi
git remote rm origin || true
git remote add origin "${remote_repo}"
git add --all
Expand Down

0 comments on commit 0bdd00b

Please sign in to comment.