@@ -15,37 +15,37 @@ echo "Checking if issue is a pull request..."
1515(jq -r " .issue.pull_request.url" " $GITHUB_EVENT_PATH " ) || exit $NEUTRAL_EXIT_CODE
1616
1717if [[ " $( jq -r " .action" " $GITHUB_EVENT_PATH " ) " != " created" ]]; then
18- echo " This is not a new comment event!"
19- exit $NEUTRAL_EXIT_CODE
18+ echo " This is not a new comment event!"
19+ exit $NEUTRAL_EXIT_CODE
2020fi
2121
2222PR_NUMBER=$( jq -r " .issue.number" " $GITHUB_EVENT_PATH " )
2323echo " Collecting information about PR #$PR_NUMBER of $GITHUB_REPOSITORY ..."
2424
2525if [[ -z " $GITHUB_TOKEN " ]]; then
26- echo " Set the GITHUB_TOKEN env variable."
27- exit 1
26+ echo " Set the GITHUB_TOKEN env variable."
27+ exit 1
2828fi
2929
3030URI=https://api.github.com
3131API_HEADER=" Accept: application/vnd.github.v3+json"
3232AUTH_HEADER=" Authorization: token $GITHUB_TOKEN "
3333
3434pr_resp=$( curl -X GET -s -H " ${AUTH_HEADER} " -H " ${API_HEADER} " \
35- " ${URI} /repos/$GITHUB_REPOSITORY /pulls/$PR_NUMBER " )
35+ " ${URI} /repos/$GITHUB_REPOSITORY /pulls/$PR_NUMBER " )
3636
3737BASE_REPO=$( echo " $pr_resp " | jq -r .base.repo.full_name)
3838BASE_BRANCH=$( echo " $pr_resp " | jq -r .base.ref)
3939
4040if [[ " $( echo " $pr_resp " | jq -r .rebaseable) " != " true" ]]; then
41- echo " GitHub doesn't think that the PR is rebaseable!"
42- exit 1
41+ echo " GitHub doesn't think that the PR is rebaseable!"
42+ exit 1
4343fi
4444
4545if [[ -z " $BASE_BRANCH " ]]; then
46- echo " Cannot get base branch information for PR #$PR_NUMBER !"
47- echo " API response: $pr_resp "
48- exit 1
46+ echo " Cannot get base branch information for PR #$PR_NUMBER !"
47+ echo " API response: $pr_resp "
48+ exit 1
4949fi
5050
5151HEAD_REPO=$( echo " $pr_resp " | jq -r .head.repo.full_name)
@@ -54,8 +54,8 @@ HEAD_BRANCH=$(echo "$pr_resp" | jq -r .head.ref)
5454echo " Base branch for PR #$PR_NUMBER is $BASE_BRANCH "
5555
5656if [[ " $BASE_REPO " != " $HEAD_REPO " ]]; then
57- echo " PRs from forks are not supported at the moment."
58- exit 1
57+ echo " PRs from forks are not supported at the moment."
58+ exit 1
5959fi
6060
6161git remote set-url origin https://x-access-token:$GITHUB_TOKEN @github.com/$GITHUB_REPOSITORY .git
@@ -73,7 +73,7 @@ git checkout -b $HEAD_BRANCH origin/$HEAD_BRANCH
7373
7474# Do an exact check instead of `rebase *` so it's not possible to inject malisios commands
7575if [[ $( jq -r " .comment.body" " $GITHUB_EVENT_PATH " | grep -Fq " /rebase --autosquash" ) -eq 0 ]]; then
76- git rebase --autosquash origin/$BASE_BRANCH
76+ git rebase --autosquash origin/$BASE_BRANCH
7777else
7878 git rebase origin/$BASE_BRANCH
7979fi
0 commit comments