Skip to content

Commit cd85006

Browse files
committed
Fix COMMIT_SHA when generating PR artifacts
Follow-up to facebook#31850. We want to build using the original commit SHA, not the merge commit that GitHub Actions creates behind the scenes. We were already checking out the correct commit object, but the COMMIT_SHA artifact was still pointing to the merge commit. This fix the sizebot links to point to working URLs, too.
1 parent cd28a94 commit cd85006

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/runtime_build_and_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ jobs:
330330
merge-multiple: true
331331
- name: Display structure of build
332332
run: ls -R build
333-
- run: echo ${{ github.sha }} >> build/COMMIT_SHA
333+
- run: echo ${{ github.event.pull_request.head.sha || github.sha }} >> build/COMMIT_SHA
334334
- name: Scrape warning messages
335335
run: |
336336
mkdir -p ./build/__test_utils__
@@ -664,7 +664,7 @@ jobs:
664664
node ./scripts/print-warnings/print-warnings.js > build/__test_utils__/ReactAllWarnings.js
665665
- name: Display structure of build for PR
666666
run: ls -R build
667-
- run: echo ${{ github.sha }} >> build/COMMIT_SHA
667+
- run: echo ${{ github.event.pull_request.head.sha || github.sha }} >> build/COMMIT_SHA
668668
- run: node ./scripts/tasks/danger
669669
- name: Archive sizebot results
670670
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)