From 266dad863d14a13c285cca1e09e15fd44720bd9d Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Tue, 15 Apr 2025 13:48:48 +0200 Subject: [PATCH] CI: Use workflow run's event commit SHA for JS benchmarks Chaining workflows does not cause the subsequently spawned workflow runs to use the same event, but rather it uses the latest head SHA based on the branch it runs on. This would cause the JS benchmarks jobs to not be able to find artifacts (if a new JS repl workflow was started before the previous one could finish) and/or assign the wrong commit SHA to the benchmark results. Since `github.event` contains information about the original workflow run that spawned the JS benchmarks jobs, we can take the commit SHA from there and use it to download the correct artifact. --- .github/workflows/js-benchmarks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/js-benchmarks.yml b/.github/workflows/js-benchmarks.yml index 671b7467a22..ea29ff539dc 100644 --- a/.github/workflows/js-benchmarks.yml +++ b/.github/workflows/js-benchmarks.yml @@ -46,7 +46,7 @@ jobs: uses: dawidd6/action-download-artifact@v9 with: workflow: js-artifacts.yml - commit: ${{ github.sha }} + commit: ${{ github.event.head_sha }} name: ladybird-js-${{ matrix.package_type }} path: js-repl @@ -76,7 +76,7 @@ jobs: shell: bash run: | echo '{ - "commit": "${{ github.sha }}", + "commit": "${{ github.event.head_sha }}", "os": "${{ matrix.os_name }}", "arch": "${{ matrix.arch }}", "artifact": "js-benchmarks-results-${{ matrix.os_name }}-${{ matrix.arch }}"