Skip to content

Commit 0bdd00b

Browse files
committed
feat: Add username and useremail options
Close #66
1 parent d772f4e commit 0bdd00b

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ inputs:
2020
description: 'Keep only the latest commit on a GitHub Pages branch'
2121
required: false
2222
default: 'false'
23+
username:
24+
description: 'Set Git user.name'
25+
required: false
26+
useremail:
27+
description: 'Set Git user.email'
28+
required: false

entrypoint.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,16 @@ else
102102
fi
103103

104104
# push to publishing branch
105-
git config user.name "${GITHUB_ACTOR}"
106-
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
105+
if [[ -n "${INPUT_USERNAME}" ]]; then
106+
git config user.name "${INPUT_USERNAME}"
107+
else
108+
git config user.name "${GITHUB_ACTOR}"
109+
fi
110+
if [[ -n "${INPUT_USEREMAIL}" ]]; then
111+
git config user.email "${INPUT_USEREMAIL}"
112+
else
113+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
114+
fi
107115
git remote rm origin || true
108116
git remote add origin "${remote_repo}"
109117
git add --all

0 commit comments

Comments
 (0)