File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,15 @@ echo "Repository: ${INPUT_REPOSITORY}"
69
69
echo " Actor: ${GITHUB_ACTOR} "
70
70
71
71
if [[ $INPUT_PUSH == ' true' ]]; then
72
- echo " Pushing to branch..."
73
- REMOTE_REPO=" https://${GITHUB_ACTOR} :${INPUT_GITHUB_TOKEN} @github.com/${INPUT_REPOSITORY} .git"
74
- git pull " $REMOTE_REPO " " $INPUT_BRANCH "
75
- git push " $REMOTE_REPO " " HEAD:${INPUT_BRANCH} " --tags
72
+ if [[ $GITHUB_EVENT_NAME == ' pull_request' ]]; then
73
+ echo " Refusing to push on pull_request event since that would merge the pull request." >&2
74
+ echo " You probably want to run on push to your default branch instead." >&2
75
+ else
76
+ echo " Pushing to branch..."
77
+ REMOTE_REPO=" https://${GITHUB_ACTOR} :${INPUT_GITHUB_TOKEN} @github.com/${INPUT_REPOSITORY} .git"
78
+ git pull " $REMOTE_REPO " " $INPUT_BRANCH "
79
+ git push " $REMOTE_REPO " " HEAD:${INPUT_BRANCH} " --tags
80
+ fi
76
81
else
77
82
echo " Not pushing"
78
83
fi
You can’t perform that action at this time.
0 commit comments