Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 5

Unable to do a multiline run command

Solved! Go to Solution.

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

4 Replies
Highlighted
Ground Controller Lvl 2
Message 2 of 5

Re: Unable to do a multiline run command

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

Fix that ^ and it should work

 

 

Highlighted
Solution
Ground Controller Lvl 2
Message 3 of 5

Re: Unable to do a multiline run command

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
Highlighted
Copilot Lvl 3
Message 4 of 5

Re: Unable to do a multiline run command

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

Thanks so much! :) 

Highlighted
Copilot Lvl 3
Message 5 of 5

Re: Unable to do a multiline run command

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