From 7a9f681d164d1d7c593a10577cb74a574e1ad024 Mon Sep 17 00:00:00 2001 From: BryanFRD Date: Sun, 25 Oct 2026 10:21:31 +0100 Subject: [PATCH] fix(action): pick baseline artifact from main and skip expired ones --- action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 8697531..887f6b5 100644 --- a/action.yml +++ b/action.yml @@ -136,8 +136,8 @@ runs: id: find-baseline shell: bash run: | - RUN_ID=$(gh api "repos/${{ github.repository }}/actions/artifacts?name=criterion-baseline&per_page=1" \ - --jq '.artifacts[0].workflow_run.id // empty') + RUN_ID=$(gh api "repos/${{ github.repository }}/actions/artifacts?name=criterion-baseline&per_page=100" \ + --jq '[.artifacts[] | select(.expired == false and .workflow_run.head_branch == "main" and .workflow_run.head_repository_id == ${{ github.repository_id }})][0].workflow_run.id // empty') echo "run_id=${RUN_ID}" >> "$GITHUB_OUTPUT" env: GH_TOKEN: ${{ inputs.ferrflow-token }} @@ -287,8 +287,8 @@ runs: GH_TOKEN: ${{ inputs.ferrflow-token }} REPO: ${{ github.repository }} run: | - RUN_ID=$(gh api "repos/$REPO/actions/artifacts?name=hyperfine-baseline&per_page=1" \ - --jq '.artifacts[0].workflow_run.id // empty') + RUN_ID=$(gh api "repos/$REPO/actions/artifacts?name=hyperfine-baseline&per_page=100" \ + --jq '[.artifacts[] | select(.expired == false and .workflow_run.head_branch == "main" and .workflow_run.head_repository_id == ${{ github.repository_id }})][0].workflow_run.id // empty') echo "run_id=${RUN_ID}" >> "$GITHUB_OUTPUT" continue-on-error: true