File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8888 - name : Setup environment
8989 uses : ./.github/actions/setup-environment-action
9090 - name : Fetch base branch for Spotless ratchet
91- if : github.event.pull_request.base.ref != ''
91+ env :
92+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
9293 run : |
93- git fetch --no-tags --prune --depth=1 origin ${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }}
94+ if [ "${{ github.event_name }}" = "pull_request_target" ]; then
95+ BASE_REF="${{ github.event.pull_request.base.ref }}"
96+ elif [ "${{ github.event_name }}" = "issue_comment" ]; then
97+ BASE_REF=$(gh pr view ${{ github.event.issue.number }} --repo ${{ github.repository }} --json baseRefName --jq .baseRefName)
98+ else
99+ BASE_REF="master"
100+ fi
101+ echo "Base ref is $BASE_REF"
102+ if [ -n "$BASE_REF" ]; then
103+ git fetch --no-tags --prune --depth=1 origin ${BASE_REF}:refs/remotes/origin/${BASE_REF}
104+ fi
94105 shell : bash
95106 - name : run Spotless PreCommit script
96107 uses : ./.github/actions/gradle-command-self-hosted-action
You can’t perform that action at this time.
0 commit comments