From e454ec2044fbb6b77c4c69ad26c5e5c2427458c5 Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Fri, 16 Feb 2024 18:04:17 +0100 Subject: [PATCH] Head sha revert (#271) * fix: get workflows only for commit In f6b0bac the check on the commit value provided was moved to the body of the function. Instead directly provide it as parameter of the request as it was before assuming that this might affect the number of requests sent. * test: check download without workflow set This tests searching for a workflow if not provided. --- .github/workflows/download.yml | 13 +++++++++++++ main.js | 4 +--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/download.yml b/.github/workflows/download.yml index 03c2d14f..2cadcae8 100644 --- a/.github/workflows/download.yml +++ b/.github/workflows/download.yml @@ -26,6 +26,19 @@ jobs: path: artifact - name: Test run: cat artifact/sha | grep $GITHUB_SHA + download-search-workflow: + runs-on: ubuntu-latest + needs: wait + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Download + uses: ./ + with: + name: artifact + path: artifact + - name: Test + run: cat artifact/sha | grep $GITHUB_SHA download-branch: runs-on: ubuntu-latest needs: wait diff --git a/main.js b/main.js index 422d9088..e087aebf 100644 --- a/main.js +++ b/main.js @@ -121,12 +121,10 @@ async function main() { ...(workflow ? { workflow_id: workflow } : {}), ...(branch ? { branch } : {}), ...(event ? { event } : {}), + ...(commit ? { head_sha: commit } : {}), } )) { for (const run of runs.data) { - if (commit && run.head_sha != commit) { - continue - } if (runNumber && run.run_number != runNumber) { continue }