Skip to content

Commit 73e4ba4

Browse files
committed
Allow runtime_build_and_test action to trigger manually (#33796)
1 parent 5a1eb6f commit 73e4ba4

File tree

1 file changed

+25
-19
lines changed

1 file changed

+25
-19
lines changed

.github/workflows/runtime_build_and_test.yml

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
pull_request:
77
paths-ignore:
88
- compiler/**
9+
workflow_dispatch:
10+
inputs:
11+
commit_sha:
12+
required: false
13+
type: string
14+
default: ''
915

1016
permissions: {}
1117

@@ -28,7 +34,7 @@ jobs:
2834
steps:
2935
- uses: actions/checkout@v4
3036
with:
31-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
37+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
3238
- name: Check cache hit
3339
uses: actions/cache/restore@v4
3440
id: node_modules
@@ -69,7 +75,7 @@ jobs:
6975
steps:
7076
- uses: actions/checkout@v4
7177
with:
72-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
78+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
7379
- name: Check cache hit
7480
uses: actions/cache/restore@v4
7581
id: node_modules
@@ -117,7 +123,7 @@ jobs:
117123
steps:
118124
- uses: actions/checkout@v4
119125
with:
120-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
126+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
121127
- uses: actions/github-script@v7
122128
id: set-matrix
123129
with:
@@ -136,7 +142,7 @@ jobs:
136142
steps:
137143
- uses: actions/checkout@v4
138144
with:
139-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
145+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
140146
- uses: actions/setup-node@v4
141147
with:
142148
node-version-file: '.nvmrc'
@@ -166,7 +172,7 @@ jobs:
166172
steps:
167173
- uses: actions/checkout@v4
168174
with:
169-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
175+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
170176
- uses: actions/setup-node@v4
171177
with:
172178
node-version-file: '.nvmrc'
@@ -198,7 +204,7 @@ jobs:
198204
steps:
199205
- uses: actions/checkout@v4
200206
with:
201-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
207+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
202208
- uses: actions/setup-node@v4
203209
with:
204210
node-version-file: '.nvmrc'
@@ -254,7 +260,7 @@ jobs:
254260
steps:
255261
- uses: actions/checkout@v4
256262
with:
257-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
263+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
258264
- uses: actions/setup-node@v4
259265
with:
260266
node-version-file: '.nvmrc'
@@ -294,7 +300,7 @@ jobs:
294300
steps:
295301
- uses: actions/checkout@v4
296302
with:
297-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
303+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
298304
- uses: actions/setup-node@v4
299305
with:
300306
node-version-file: '.nvmrc'
@@ -389,7 +395,7 @@ jobs:
389395
steps:
390396
- uses: actions/checkout@v4
391397
with:
392-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
398+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
393399
- uses: actions/setup-node@v4
394400
with:
395401
node-version-file: '.nvmrc'
@@ -430,7 +436,7 @@ jobs:
430436
steps:
431437
- uses: actions/checkout@v4
432438
with:
433-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
439+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
434440
- uses: actions/setup-node@v4
435441
with:
436442
node-version-file: '.nvmrc'
@@ -458,7 +464,7 @@ jobs:
458464
merge-multiple: true
459465
- name: Display structure of build
460466
run: ls -R build
461-
- run: echo ${{ github.event.pull_request.head.sha || github.sha }} >> build/COMMIT_SHA
467+
- run: echo ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }} >> build/COMMIT_SHA
462468
- name: Scrape warning messages
463469
run: |
464470
mkdir -p ./build/__test_utils__
@@ -483,7 +489,7 @@ jobs:
483489
steps:
484490
- uses: actions/checkout@v4
485491
with:
486-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
492+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
487493
- uses: actions/setup-node@v4
488494
with:
489495
node-version-file: '.nvmrc'
@@ -523,7 +529,7 @@ jobs:
523529
steps:
524530
- uses: actions/checkout@v4
525531
with:
526-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
532+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
527533
- uses: actions/setup-node@v4
528534
with:
529535
node-version-file: '.nvmrc'
@@ -560,7 +566,7 @@ jobs:
560566
steps:
561567
- uses: actions/checkout@v4
562568
with:
563-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
569+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
564570
- uses: actions/setup-node@v4
565571
with:
566572
node-version-file: '.nvmrc'
@@ -601,7 +607,7 @@ jobs:
601607
steps:
602608
- uses: actions/checkout@v4
603609
with:
604-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
610+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
605611
- uses: actions/setup-node@v4
606612
with:
607613
node-version-file: '.nvmrc'
@@ -675,7 +681,7 @@ jobs:
675681
steps:
676682
- uses: actions/checkout@v4
677683
with:
678-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
684+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
679685
- uses: actions/setup-node@v4
680686
with:
681687
node-version-file: '.nvmrc'
@@ -732,7 +738,7 @@ jobs:
732738
steps:
733739
- uses: actions/checkout@v4
734740
with:
735-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
741+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
736742
- uses: actions/setup-node@v4
737743
with:
738744
node-version-file: '.nvmrc'
@@ -777,7 +783,7 @@ jobs:
777783
steps:
778784
- uses: actions/checkout@v4
779785
with:
780-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
786+
ref: ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }}
781787
- uses: actions/setup-node@v4
782788
with:
783789
node-version-file: '.nvmrc'
@@ -822,7 +828,7 @@ jobs:
822828
node ./scripts/print-warnings/print-warnings.js > build/__test_utils__/ReactAllWarnings.js
823829
- name: Display structure of build for PR
824830
run: ls -R build
825-
- run: echo ${{ github.event.pull_request.head.sha || github.sha }} >> build/COMMIT_SHA
831+
- run: echo ${{ github.event.inputs.commit_sha != '' && github.event.inputs.commit_sha || github.event.pull_request.head.sha || github.sha }} >> build/COMMIT_SHA
826832
- run: node ./scripts/tasks/danger
827833
- name: Archive sizebot results
828834
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)