Skip to content

Commit 9463d51

Browse files
authored
Update runtime workflow to use HEAD commit (facebook#31850)
This updates the CI workflow for the runtime build and tests to use the HEAD commit of the PR branch rather than the Fake News merge commit that the `@actions/checkout` action bafflingly defaults to. Testing against the merge commit never made sense to me as a behavior because as soon as someone updates upstream, it's out of date anyway. It should just match the exact commit that the developer pushed, and the once that appears in the GitHub UI.
1 parent a9bbe34 commit 9463d51

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/runtime_build_and_test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
matrix: ${{ steps.set-matrix.outputs.result }}
2626
steps:
2727
- uses: actions/checkout@v4
28+
with:
29+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
2830
- uses: actions/github-script@v7
2931
id: set-matrix
3032
with:
@@ -42,6 +44,8 @@ jobs:
4244
flow_inline_config_shortname: ${{ fromJSON(needs.discover_flow_inline_configs.outputs.matrix) }}
4345
steps:
4446
- uses: actions/checkout@v4
47+
with:
48+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
4549
- uses: actions/setup-node@v4
4650
with:
4751
node-version-file: '.nvmrc'
@@ -64,6 +68,8 @@ jobs:
6468
runs-on: ubuntu-latest
6569
steps:
6670
- uses: actions/checkout@v4
71+
with:
72+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
6773
- uses: actions/setup-node@v4
6874
with:
6975
node-version-file: '.nvmrc'
@@ -88,6 +94,8 @@ jobs:
8894
runs-on: ubuntu-latest
8995
steps:
9096
- uses: actions/checkout@v4
97+
with:
98+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
9199
- uses: actions/setup-node@v4
92100
with:
93101
node-version-file: '.nvmrc'
@@ -139,6 +147,8 @@ jobs:
139147
continue-on-error: true
140148
steps:
141149
- uses: actions/checkout@v4
150+
with:
151+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
142152
- uses: actions/setup-node@v4
143153
with:
144154
node-version-file: '.nvmrc'
@@ -166,6 +176,8 @@ jobs:
166176
release_channel: [stable, experimental]
167177
steps:
168178
- uses: actions/checkout@v4
179+
with:
180+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
169181
- uses: actions/setup-node@v4
170182
with:
171183
node-version-file: '.nvmrc'
@@ -242,6 +254,8 @@ jobs:
242254
runs-on: ubuntu-latest
243255
steps:
244256
- uses: actions/checkout@v4
257+
with:
258+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
245259
- uses: actions/setup-node@v4
246260
with:
247261
node-version-file: '.nvmrc'
@@ -272,6 +286,8 @@ jobs:
272286
runs-on: ubuntu-latest
273287
steps:
274288
- uses: actions/checkout@v4
289+
with:
290+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
275291
- uses: actions/setup-node@v4
276292
with:
277293
node-version-file: '.nvmrc'
@@ -317,6 +333,8 @@ jobs:
317333
runs-on: ubuntu-latest
318334
steps:
319335
- uses: actions/checkout@v4
336+
with:
337+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
320338
- uses: actions/setup-node@v4
321339
with:
322340
node-version-file: '.nvmrc'
@@ -350,6 +368,8 @@ jobs:
350368
runs-on: ubuntu-latest
351369
steps:
352370
- uses: actions/checkout@v4
371+
with:
372+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
353373
- uses: actions/setup-node@v4
354374
with:
355375
node-version-file: '.nvmrc'
@@ -380,6 +400,8 @@ jobs:
380400
runs-on: ubuntu-latest
381401
steps:
382402
- uses: actions/checkout@v4
403+
with:
404+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
383405
- uses: actions/setup-node@v4
384406
with:
385407
node-version-file: '.nvmrc'
@@ -419,6 +441,8 @@ jobs:
419441
runs-on: ubuntu-latest
420442
steps:
421443
- uses: actions/checkout@v4
444+
with:
445+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
422446
- uses: actions/setup-node@v4
423447
with:
424448
node-version-file: '.nvmrc'
@@ -480,6 +504,8 @@ jobs:
480504
runs-on: ubuntu-latest
481505
steps:
482506
- uses: actions/checkout@v4
507+
with:
508+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
483509
- uses: actions/setup-node@v4
484510
with:
485511
node-version-file: '.nvmrc'
@@ -528,6 +554,8 @@ jobs:
528554
runs-on: ubuntu-latest
529555
steps:
530556
- uses: actions/checkout@v4
557+
with:
558+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
531559
- uses: actions/setup-node@v4
532560
with:
533561
node-version-file: '.nvmrc'
@@ -562,6 +590,8 @@ jobs:
562590
runs-on: ubuntu-latest
563591
steps:
564592
- uses: actions/checkout@v4
593+
with:
594+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
565595
- uses: actions/setup-node@v4
566596
with:
567597
node-version-file: '.nvmrc'
@@ -603,6 +633,8 @@ jobs:
603633
runs-on: ubuntu-latest
604634
steps:
605635
- uses: actions/checkout@v4
636+
with:
637+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
606638
- uses: actions/setup-node@v4
607639
with:
608640
node-version-file: '.nvmrc'

0 commit comments

Comments
 (0)