Skip to content

Commit

Permalink
fix(bundle-size): prevent errors by selecting the latest artifact if …
Browse files Browse the repository at this point in the history
…multiple are returned by api
  • Loading branch information
jackw committed Nov 25, 2024
1 parent 6b6a660 commit 0f14d2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bundle-size/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ runs:
env:
GH_TOKEN: ${{ inputs.token }}
run: |
MAIN_STATS_RUN_ID=$(gh api /repos/${{ github.repository }}/actions/artifacts --jq ".artifacts[] | select(.name == \"main-branch-stats\") | .workflow_run.id")
MAIN_STATS_RUN_ID=$(gh api /repos/${{ github.repository }}/actions/artifacts --jq ".artifacts | map(select(.name == \"main-branch-stats\")) | sort_by(.created_at) | reverse | .[0].workflow_run.id")
echo "run-id=${MAIN_STATS_RUN_ID}" >> $GITHUB_OUTPUT
shell: bash

Expand Down

0 comments on commit 0f14d2f

Please sign in to comment.