Skip to content

Commit 235496f

Browse files
committed
optionally provide username and email for git
1 parent d358037 commit 235496f

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ jobs:
5858
| --- | --- | --- |
5959
| REPOSITORIES | true | List of repositories to sync the files to. Optionally provide branch name |
6060
| FILES | true | List of files to sync across repositories. See below for details |
61-
| TOKEN | true | Personal Access Token with Repo scope |
6261
| PULL_REQUEST_BRANCH_NAME | false | Branch name of branch to do pull request into. Default is no pull request opened |
62+
| GIT_EMAIL | false | Git email to use |
63+
| GIT_USERNAME | false | Git username to use |
64+
| TOKEN | true | Personal Access Token with Repo scope |
6365
6466
## Examples
6567
### REPOSITORIES parameter

action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ inputs:
1818
description: 'Branch name to submit pull request to'
1919
required: false
2020
default: ''
21+
GIT_EMAIL:
22+
description: 'Email to use for Git'
23+
required: false
24+
default: '41898282+github-actions[bot]@users.noreply.github.com'
25+
GIT_USERNAME:
26+
description: 'Username to use for Git'
27+
required: false
28+
default: 'github-actions[bot]'
2129

2230
runs:
2331
using: 'docker'

entrypoint.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ FILES=($RAW_FILES)
2323
echo "Files : $FILES"
2424
PULL_REQUEST_BRANCH_NAME="$INPUT_PULL_REQUEST_BRANCH_NAME"
2525
echo "Pull request : $PULL_REQUEST_BRANCH_NAME"
26+
GIT_EMAIL="$INPUT_GIT_EMAIL"
27+
echo "Git email : $GIT_EMAIL"
28+
GIT_USERNAME="$GIT_USERNAME"
29+
echo "Git username : $GIT_USERNAME"
2630

2731
# set temp path
2832
TEMP_PATH="/ghafs/"
@@ -38,7 +42,7 @@ echo " "
3842
echo "Initializing git with github-actions[bot]"
3943
git config --system core.longpaths true
4044
git config --global core.longpaths true
41-
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" && git config --global user.name "github-actions[bot]"
45+
git config --global user.email "$GIT_EMAIL" && git config --global user.name "$GIT_USERNAME"
4246
echo "Git initialized"
4347

4448
echo " "

0 commit comments

Comments
 (0)