Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
Merge pull request #1 from dawidd6/master
Browse files Browse the repository at this point in the history
Use `commit` as `head_sha` to reduce number of API calls (dawidd6#227)
  • Loading branch information
gknopf-spideroak authored Mar 14, 2023
2 parents b59d8c6 + 5e780fc commit 7ef430a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ jobs:
pr: ${{github.event.pull_request.number}}
- name: Test
run: cat artifact/sha | grep $GITHUB_SHA
download-commit:
runs-on: ubuntu-latest
needs: wait
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download
uses: ./
with:
workflow: upload.yml
name: artifact
path: artifact
commit: ${{ github.event.workflow_run.head_sha }}
- name: Test
run: cat artifact/sha | grep $GITHUB_SHA
download-multiple:
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 @@ -109,12 +109,10 @@ async function main() {
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 7ef430a

Please sign in to comment.