Skip to content

Commit 0c08479

Browse files
authored
Merge pull request #1186 from square/rick/check-out-head_ref
always check out the `github.head_ref` in CI
2 parents a3aa2e7 + b61c214 commit 0c08479

File tree

1 file changed

+72
-18
lines changed

1 file changed

+72
-18
lines changed

.github/workflows/kotlin.yml

Lines changed: 72 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ jobs :
2626
name : Build all
2727
runs-on : workflow-kotlin-test-runner-ubuntu-4core
2828
steps :
29-
- uses : actions/checkout@v3
29+
- name: Checkout
30+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
31+
with:
32+
ref: ${{ github.head_ref }}
3033

3134
- name : main build
3235
uses : ./.github/actions/gradle-task
@@ -39,7 +42,10 @@ jobs :
3942
runs-on : ubuntu-latest
4043
needs : build-all
4144
steps :
42-
- uses : actions/checkout@v3
45+
- name: Checkout
46+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
47+
with:
48+
ref: ${{ github.head_ref }}
4349

4450
- name : Run dokka to validate kdoc
4551
uses : ./.github/actions/gradle-task
@@ -51,7 +57,10 @@ jobs :
5157
name : Shard Matrix Yaml
5258
runs-on : workflow-kotlin-test-runner-ubuntu-4core
5359
steps :
54-
- uses : actions/checkout@v3
60+
- name: Checkout
61+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
62+
with:
63+
ref: ${{ github.head_ref }}
5564

5665
- name : check published artifacts
5766
uses : ./.github/actions/gradle-task-with-commit
@@ -66,7 +75,10 @@ jobs :
6675
# the `artifactsCheck` task has to run on macOS in order to see the iOS KMP artifacts
6776
runs-on : macos-latest
6877
steps :
69-
- uses : actions/checkout@v3
78+
- name: Checkout
79+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
80+
with:
81+
ref: ${{ github.head_ref }}
7082

7183
- name : check published artifacts
7284
uses : ./.github/actions/gradle-task-with-commit
@@ -80,7 +92,10 @@ jobs :
8092
name : Dependency Guard
8193
runs-on : ubuntu-latest
8294
steps :
83-
- uses : actions/checkout@v3
95+
- name: Checkout
96+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
97+
with:
98+
ref: ${{ github.head_ref }}
8499

85100
# If the PR was made by a maintainer or Renovate, automatically update baselines and push
86101
# so that no one has to check out the branch and update the baselines manually.
@@ -96,7 +111,10 @@ jobs :
96111
name : KtLint
97112
runs-on : ubuntu-latest
98113
steps :
99-
- uses : actions/checkout@v3
114+
- name: Checkout
115+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
116+
with:
117+
ref: ${{ github.head_ref }}
100118

101119
# If the PR was made by a maintainer or Renovate, automatically format and push
102120
# so that no one has to check out the branch and do it manually.
@@ -112,7 +130,10 @@ jobs :
112130
name : Api check
113131
runs-on : ubuntu-latest
114132
steps :
115-
- uses : actions/checkout@v3
133+
- name: Checkout
134+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
135+
with:
136+
ref: ${{ github.head_ref }}
116137

117138
# If the PR was made by a maintainer or Renovate, automatically format and push
118139
# so that no one has to check out the branch and do it manually.
@@ -130,7 +151,10 @@ jobs :
130151
needs : build-all
131152
timeout-minutes : 20
132153
steps :
133-
- uses : actions/checkout@v3
154+
- name: Checkout
155+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
156+
with:
157+
ref: ${{ github.head_ref }}
134158
- name : Check with Gradle
135159
uses : ./.github/actions/gradle-task
136160
with :
@@ -143,7 +167,10 @@ jobs :
143167
needs : build-all
144168
timeout-minutes : 20
145169
steps :
146-
- uses : actions/checkout@v3
170+
- name: Checkout
171+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
172+
with:
173+
ref: ${{ github.head_ref }}
147174
- name : Check with Gradle
148175
uses : ./.github/actions/gradle-task
149176
with :
@@ -167,7 +194,10 @@ jobs :
167194
timeout-minutes : 15
168195
steps :
169196
# These setup steps should be common across all jobs in this workflow.
170-
- uses : actions/checkout@v3
197+
- name: Checkout
198+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
199+
with:
200+
ref: ${{ github.head_ref }}
171201
- name : build tutorials
172202
uses : ./.github/actions/gradle-task
173203
with :
@@ -180,7 +210,10 @@ jobs :
180210
runs-on : ubuntu-latest
181211
timeout-minutes : 20
182212
steps :
183-
- uses : actions/checkout@v3
213+
- name: Checkout
214+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
215+
with:
216+
ref: ${{ github.head_ref }}
184217
- name : Check with Gradle
185218
uses : ./.github/actions/gradle-task
186219
with :
@@ -199,7 +232,10 @@ jobs :
199232
runs-on : ubuntu-latest
200233
timeout-minutes : 20
201234
steps :
202-
- uses : actions/checkout@v3
235+
- name: Checkout
236+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
237+
with:
238+
ref: ${{ github.head_ref }}
203239
- name : Check with Gradle
204240
uses : ./.github/actions/gradle-task
205241
with :
@@ -218,7 +254,10 @@ jobs :
218254
runs-on : ubuntu-latest
219255
timeout-minutes : 20
220256
steps :
221-
- uses : actions/checkout@v3
257+
- name: Checkout
258+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
259+
with:
260+
ref: ${{ github.head_ref }}
222261
- name : Check with Gradle
223262
uses : ./.github/actions/gradle-task
224263
with :
@@ -237,7 +276,10 @@ jobs :
237276
runs-on : macos-latest
238277
timeout-minutes : 30
239278
steps :
240-
- uses : actions/checkout@v3
279+
- name: Checkout
280+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
281+
with:
282+
ref: ${{ github.head_ref }}
241283
- name : Check with Gradle
242284
uses : ./.github/actions/gradle-task
243285
with :
@@ -256,7 +298,10 @@ jobs :
256298
runs-on : ubuntu-latest
257299
timeout-minutes : 20
258300
steps :
259-
- uses : actions/checkout@v3
301+
- name: Checkout
302+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
303+
with:
304+
ref: ${{ github.head_ref }}
260305

261306
## JS Specific Tests (for KMP js actuals in core and runtime).
262307
- name : Check with Gradle
@@ -283,7 +328,10 @@ jobs :
283328
api-level :
284329
- 31
285330
steps :
286-
- uses : actions/checkout@v3
331+
- name: Checkout
332+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
333+
with:
334+
ref: ${{ github.head_ref }}
287335

288336
- name : Instrumented tests
289337
uses : ./.github/actions/gradle-tasks-with-emulator
@@ -307,7 +355,10 @@ jobs :
307355
shardNum: [ 1, 2, 3 ]
308356
### <end-connected-check-shards>
309357
steps :
310-
- uses : actions/checkout@v3
358+
- name: Checkout
359+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
360+
with:
361+
ref: ${{ github.head_ref }}
311362

312363
- name : Instrumented tests
313364
uses : ./.github/actions/gradle-tasks-with-emulator
@@ -333,7 +384,10 @@ jobs :
333384
### <end-connected-check-shards>
334385
runtime : [ conflate, baseline-stateChange, conflate-stateChange ]
335386
steps :
336-
- uses : actions/checkout@v3
387+
- name: Checkout
388+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
389+
with:
390+
ref: ${{ github.head_ref }}
337391

338392
- name : Instrumented tests
339393
uses : ./.github/actions/gradle-tasks-with-emulator

0 commit comments

Comments
 (0)