From b2484038deaa33ffd828c2408b539c59a1f1dbbf Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Fri, 16 Feb 2024 08:46:15 +0100 Subject: [PATCH 1/2] 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. --- main.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 } From b048b8a4a3869fbc995485a9b8b0c4ec1199fcf8 Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Fri, 16 Feb 2024 08:50:57 +0100 Subject: [PATCH 2/2] test: check download without workflow set This tests searching for a workflow if not provided. --- .github/workflows/download.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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