@@ -31,52 +31,19 @@ jobs:
3131 uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3232 with :
3333 ref : ${{ github.event.repository.default_branch }}
34- - name : find latest baseline run
35- id : baseline
34+ - name : download baseline results
3635 env :
3736 GH_TOKEN : ${{ github.token }}
38- WORKFLOW_RUN_ID : ${{ github.event.workflow_run.id }}
39- run : |
40- run_id="$WORKFLOW_RUN_ID"
41- if [[ -z "$run_id" ]]; then
42- run_id="$(gh run list \
43- --workflow baseline.yml \
44- --branch "${{ github.event.repository.default_branch }}" \
45- --status success \
46- --limit 1 \
47- --json databaseId \
48- --jq '.[0].databaseId // empty')"
49- fi
50- echo "run-id=$run_id" >> "$GITHUB_OUTPUT"
51- - name : download baseline results
52- if : steps.baseline.outputs.run-id != ''
53- uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
54- with :
55- pattern : baseline-${{ steps.baseline.outputs.run-id }}*
56- merge-multiple : true
57- run-id : ${{ steps.baseline.outputs.run-id }}
58- github-token : ${{ github.token }}
59- - name : merge baseline results
60- if : steps.baseline.outputs.run-id != ''
6137 run : |
62- shard_output="$(find results -type f -name 'output-*.json' -print -quit)"
63- if [[ -z "$shard_output" ]]; then
64- exit 0
65- fi
66- output_directory="$(dirname "$shard_output")"
67- jq --slurp '
68- . as $outputs
69- | ([$outputs[].treatments[]] | unique_by(.config.name)) as $treatments
70- | $outputs[0]
71- | .treatments = $treatments
72- | .results = [
73- $outputs[] as $output
74- | $output.results[]
75- | . as $result
76- | ($output.treatments[] | select(.id == $result.treatmentId).config.name) as $name
77- | .treatmentId = ($treatments[] | select(.config.name == $name).id)
78- ]
79- ' "$output_directory"/output-*.json > "$output_directory/output.json"
38+ gh api --paginate \
39+ "/repos/$GITHUB_REPOSITORY/actions/artifacts?per_page=100" \
40+ --jq '.artifacts[] | select(.expired == false and (.name | test("^baseline-[0-9]+$"))) | [.created_at, .id] | @tsv' |
41+ sort |
42+ cut -f2 |
43+ while read -r artifact_id; do
44+ gh api "/repos/$GITHUB_REPOSITORY/actions/artifacts/$artifact_id/zip" > "$RUNNER_TEMP/$artifact_id.zip"
45+ unzip -o -q "$RUNNER_TEMP/$artifact_id.zip"
46+ done
8047 - name : set up pnpm
8148 uses : pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
8249 - name : set up Node.js
0 commit comments