Unable to do a multiline run command

Hi, 

Whenever I try to do multi-line run commands I keep getting the following error: 

### ERRORED 20:52:01Z

- Your workflow file was invalid: The pipeline is not valid. .github/workflows/build.yml (Line: 18, Col: 7): There's not enough info to determine what you meant. Add one of these properties: run, shell, uses, with, working-directory,.github/workflows/build.yml (Line: 22, Col: 7): Unexpected value 'run'

Below is my .yml file: 

name: build
on:
  push:
    branches-ignore:
      - 'master'
    tags-ignore:
      - v*
jobs:
  build_and_release:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1

    - name: Build
      run: docker build -t $CONTAINER_RELEASE_IMAGE:test .
      env:
        REGISTRY: registry.gitlab.com
        CONTAINER_RELEASE_IMAGE: $REGISTRY/team/group/project

    - name: Release
    - uses: actions/setup-node@v1
      with:
        node-version: '10.x'
      run: |
        npm install -g semantic-release@15.13.24 @semantic-release/exec @semantic-release/commit-analyzer
        docker login -u registryuser -p $CI_REGISTRY_TOKEN $REGISTRY
        docker push $CONTAINER_RELEASE_IMAGE:test

If I make the run command a single line everything works, but as soon as I attempt multi line commands it always fails no matter what I do. Am I doing something wrong or is this a bug?

Thanks in advance for your replies

1 Like
- name: Release
    - uses: actions/setup-node@v1

Fix that ^ and it should work

2 Likes

To be more specific – that’s actually two steps there, and one only has a name. I think it should be:

- name: Release
      uses: actions/setup-node@v1
1 Like

Nevermind I figured it out. It seems like actions and commands can’t be run in the same step. 

Haha looks like we replied at the same time. Yes I figured that out after looking at more examples. 

Thanks so much! :)