0

I am trying to learn github actions, so I purchased a course in udemy, but no response from the instructor yet.

I got stuck with the first snippet itself and getting syntax errors.

This is the action snippet I am trying, tried changing different indentations but still getting same error as syntax issue.

name: Shell commands
on: [push]
jobs:
  run-shell-command:
    runs-on: ubuntu-latest
    steps:
      - name: echo a
        string
         run: echo "hello world"
      - name: multiline
        script
          run: |
            node -v
            npm -v

Can anyone please suggest how to fix this.

Sara June
  • 389
  • 4
  • 15

1 Answers1

0

try this block:

name: Shell commands
on: [push]
jobs:
  run-shell-command:
    runs-on: ubuntu-latest
    steps:
      - name: echo a
          string
         run: echo "hello world"
      - name: multiline
        script:
          run: |
            node -v
            npm -v

you may use the foloowing webiste to help you validate your yaml code.

https://codebeautify.org/yaml-validator
Zareh Kasparian
  • 517
  • 3
  • 17