diff --git a/.github/workflows/download.yml b/.github/workflows/download.yml index 86e6c22c..0346148f 100644 --- a/.github/workflows/download.yml +++ b/.github/workflows/download.yml @@ -29,6 +29,7 @@ jobs: download-branch: runs-on: ubuntu-latest needs: wait + if: github.ref == 'refs/heads/master' steps: - name: Checkout uses: actions/checkout@v2 @@ -41,6 +42,22 @@ jobs: branch: master - name: Test run: cat artifact/sha | grep $GITHUB_SHA + download-pr: + runs-on: ubuntu-latest + needs: wait + if: github.ref != 'refs/heads/master' + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Download + uses: ./ + with: + workflow: upload.yml + name: artifact + path: artifact + pr: ${{github.event.pull_request.number}} + - name: Test + run: cat artifact/sha | grep $GITHUB_SHA download-run_id: runs-on: ubuntu-latest needs: wait diff --git a/main.js b/main.js index ea078391..bf7df77a 100644 --- a/main.js +++ b/main.js @@ -58,7 +58,7 @@ async function main() { } if (!runID) { - const endpoint = "GET /repos/:owner/:repo/actions/workflows/:id/runs?status=:status" + const endpoint = "GET /repos/:owner/:repo/actions/workflows/:id/runs?status=:status&branch=:branch" const params = { owner: owner, repo: repo,