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.
This commit is contained in:
Jelle Raaijmakers 2025-04-15 13:48:48 +02:00
parent c00c0846c0
commit 1b4a4b0225
Notes: github-actions[bot] 2025-04-15 12:14:21 +00:00

View file

@ -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 }}"