Are the YML format commands sequences

When I had my pipeline auto translated to YML I got this:

steps:
    - command: "yarn\nnpm run upload"
      label: ":npm: build & publish"
      ...

But I was told you can also do this:

steps:
    - commands:
          - yarn
          - npm run upload

Is there a difference? Is the first sequences and the second not or are they both sequenced?

Hi @dht! There’s no real difference there — you can use either one, including this too:

steps:
  - commands: |
      yarn
      npm run upload
    label: ":npm: build & publish"
    ...

All three of these will be run in the same way: the commands will be run in sequence, in the same job (and process), and will fail as soon as one of the commands fails.

Does that answer your question?

1 Like

Yes, it does, of course, tnx

1 Like