Artifacts keeps only the last in the array
Asked by Johan Karlsson:

I have a pipeline step that looks as follows:

```
- step: &build-generic
    name: Build generic app
    script:
      - npm install
      - npm run build:generic
    artifacts:
      - dist/**
      - parcel-bundle-reports/**
```

I just recently added the artifact for the *parcel-bundle-reports* folder and that broke later steps in the pipe because *dist*was no longer available as an artifact.

However, when I run this, I get only the last folder added as an artifact:

![artifact.png](https://community.atlassian.com/t5/image/serverpage/image-id/153079i05E7F36FAEB2B774/image-size/large?v=v2&px=999 "artifact.png")

What's going on here? The documentation [looks almost identical.](https://support.atlassian.com/bitbucket-cloud/docs/use-artifacts-in-steps/)

**Update**

We have other pipelines that do the same thing without issue:![artifacts.png](https://community.atlassian.com/t5/image/serverpage/image-id/153234i96B2A221362770D0/image-size/large?v=v2&px=999 "artifacts.png")


Answers:
author: Theodora Boudale
body: Hi Johan,

When you're viewing a Pipelines build, there's an icon with a cog image. If you hover it, you'll see the text "View configuration" like below:

![Screenshot 2021-07-28 at 14.13.15.png](https://community.atlassian.com/t5/image/serverpage/image-id/153308i92683DEA2ECC8704/image-size/large?v=v2&px=999 "Screenshot 2021-07-28 at 14.13.15.png")

If you select it, you'll see the yaml file used for this specific build. My first suggestion would be to select that for the build that failed, and double-check that **- dist/\*\*** is indeed included in the artifacts definition for the step that should generate them.

I have seen cases where the yaml file gets edited in different branches, so we first want to make sure that the yaml for this specific build includes **- dist/\*\*** in the artifacts definition.

If that looks ok, the second thing to check would be if the **dist** directory exists in the directory where the repository is cloned. It is possible that the directory dist does not exist, or that it exists inside another directory, or that it has no contents.

You can add the command **ls -lahR** at the end of the script that generates the artifacts and check its output in the next build that runs, to confirm if the **dist** directory is listed there and if it has any contents.

If all looks good with the yaml file, and the command ls -lahR shows that the directory dist exists in the clone directory and has contents, my next suggestion would be to open a ticket with the support team. If there is a support ticket open, the engineer working on your case will be able to access the build and investigate the issue.

I see that you're a member of a workspace on a paid plan that uses Pipelines, so you should be able to open a support ticket yourself if the issue concerns this workspace. You can open a support ticket via <https://support.atlassian.com/contact/#/>, in "What can we help you with" select "Technical issues and bugs" and then Bitbucket Cloud as product. Make sure to include the URL of the build that has this issue in the details of the ticket.

Please feel free to let me know if you have any questions.

Kind regards,  
Theodora


Tags: bitbucket-pipelines

cloud