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