Skip to content

Commit 08f162f

Browse files
fix: Refuse to run on pull_request event
Avoid merging pull requests, which is unlikely to be the intended purpose of using this action.
1 parent a653fea commit 08f162f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ if [[ -z $INPUT_GITHUB_TOKEN ]]; then
77
exit 1
88
fi
99

10+
if [[ $GITHUB_EVENT_NAME == 'pull_request' ]]; then
11+
echo "Refusing to run on pull_request event since this would merge the pull request." >&2
12+
echo "You probably want to run on push to your default branch instead." >&2
13+
exit 1
14+
fi
15+
1016
echo "Configuring Git username, email, and pull behavior..."
1117
git config --local user.name "${INPUT_GIT_NAME}"
1218
git config --local user.email "${INPUT_GIT_EMAIL}"

0 commit comments

Comments
 (0)