Skip to content

Commit

Permalink
Head sha revert (#271)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
romangg authored Feb 16, 2024
1 parent f6b0bac commit e454ec2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e454ec2

Please sign in to comment.