@@ -124,8 +124,7 @@ jobs:
124124 - name : Checkout repository
125125 uses : actions/checkout@v2
126126 with :
127- fetch-depth : 0
128- ref : ${{ github.head_ref }}
127+ ref : ${{ github.event.pull_request.head.sha }}
129128
130129 - uses : actions/setup-dotnet@v1
131130 with :
@@ -147,7 +146,7 @@ jobs:
147146 author_name : Github Actions
148147 author_email : actions@github.com
149148 message : Automated dotnet-format update
150- ref : ${{ github.head_ref }}
149+ ref : ${{ github.event.pull_request.head.sha }}
151150 env :
152151 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
153152
@@ -170,6 +169,7 @@ jobs:
170169 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
171170
172171 code-ql :
172+ if : github.event_name != 'pull_request'
173173 runs-on : ubuntu-latest
174174 steps :
175175 - name : Checkout repository
@@ -179,11 +179,6 @@ jobs:
179179 # a pull request then we can checkout the head.
180180 fetch-depth : 0
181181
182- # If this run was triggered by a pull request event, then checkout
183- # the head of the pull request instead of the merge commit.
184- - run : git checkout HEAD^2
185- if : ${{ github.event_name == 'pull_request' }}
186-
187182 - uses : actions/setup-dotnet@v1
188183 with :
189184 dotnet-version : ' 3.1.x'
0 commit comments