Search code examples
githubyamlgithub-actions

Invalid workflow file for GitHub actions


So I am just trying to learn how to use github workflow actions and made this simple starter test:

name: Basic test push
on: 
  push:
    branches:
      - 'autoupdate'

jobs:
  build:
    runs-on: ubuntu-latest
        steps:
         -  run: echo Test One Worked!

However, I get an error:

Invalid workflow file
You have an error in your yaml syntax on line 10'

Anyone know why?


Solution

  • You're indenting the steps, but it should be on the same level as runs-on:

    name: Basic test push
    
    on: 
      push:
        branches:
          - 'autoupdate'
    
    jobs:
      build:
        runs-on: ubuntu-latest
        steps:
          -  run: echo Test One Worked!