feat: Allow overriding actor (#126)

Co-authored-by: Conrad <grosserconrad@gmail.com>
This commit is contained in:
Derek Brown
2023-08-21 12:05:34 -07:00
committed by GitHub
parent 5b5cb513f1
commit 0fc0cf4723
3 changed files with 17 additions and 2 deletions

View File

@@ -17,8 +17,17 @@ _git_setup ( ) {
EOF
chmod 600 $HOME/.netrc
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Action"
# If GIT_IDENTITY="actor"
if [ "$INPUT_GIT_IDENTITY" = "author" ]; then
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "$GITHUB_ACTOR@@users.noreply.github.com"
elif [ "$INPUT_GIT_IDENTITY" = "actions" ]; then
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Action"
else
echo "GIT_IDENTITY must be either 'actor' or 'actions'";
exit 1;
fi;
}
# Checks if any files are changed