opened
tb102122
username_0
Hey @username_1,

I am running into an error when using the following combination.

`
name: Layer via Artifacts
  if: ${{ steps.git_diff.outputs.diff != true }}
  uses: username_1/action-download-artifact@v2
  with:
    workflow: review.yml
    branch: development
          `

**The error is the following:**
`
Run username_1/action-download-artifact@v2
==> Repo: username_0/BMWJPSI-BI
==> Branch: development
##[error]Cannot read property 'id' of undefined`

Not sure what I do wrong during the setup.
I basically would like to get the artifacts from the last successful PR or from the last merge into the named branch.
How can I achieve this the best?

Thanks for your help!
Cheers Tobias
error when using branch
issue
created
dawidd6
username_1
Seeing your whole workflow files would certainly help. For now I can't tell what's wrong.
comment
created
tb102122
username_0
The workflow is the following:

`name: review
on:
  pull_request:
    branches:
      - development
      - master
      - prod

jobs:
  job_prepare: ...
  job_layers:
    needs: job_prepare
    runs-on: ubuntu-latest
    strategy:
      matrix: ${{fromJson(needs.job_prepare.outputs.layer_matrix)}}
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: matrix name
        run: |
          echo $GITHUB_WORKSPACE
          echo ${{ matrix.path }}
        - name: Layer via Artifacts
        uses: username_1/action-download-artifact@v2
        with:
          workflow: review.yml
          branch: development
          name: ${{ matrix.name }}
      - name: Upload layer zip
        uses: actions/upload-artifact@v2
        with:
          name: ${{ matrix.name }}
          path: ${{ matrix.name }}.zip
  job_lambda: ...
  terraform-plan: ...`

I removed some parts for simplicity now.
comment
created
dawidd6
username_1
If you are trying to download artifact before it's uploaded, then it won't work. Otherwise I don't know what the issue is.
comment
created
tb102122
username_0
The artifact is created in a previous run.
I like to download the old version again

Cheers Tobi



-------- Original message --------
comment
created
dawidd6
username_1
Could you link to repository?
comment
created
tb102122
username_0
No the workflow run in the same repo.
Lets say I have a PR5 now and I would like to get the last successful PR e.g. 4 and download the artifact from PR4. 

I need that approach in order to have the same zip files again otherwise my terraform plan shows differences and needs to run a new apply for lambdas.
comment
created
dawidd6
username_1
Try unsetting `branch` input.
comment
created
tb102122
username_0
thanks for the tip that worked succesful!
comment
closed
tb102122
username_0
issue