Github action No event triggers defined in `on`

Viewed 8394

I have created a pipeline and i want to trigger every time I push on any branch

There is my default.yml :

name: default

on:
  push:
    branches:
    - '*'

jobs:
  build:
    runs-on: macOS-latest
    
    steps:
    - uses: actions/checkout@v1
    - name: CocoaPod Install
      run: pod install
    - name: Force xcode version
      run: sudo xcode-select -switch /Applications/Xcode_11.2.1.app
    - name: Build
      run: ./pipelines.sh build

When i push this on github, I have this error

No event triggers defined in on

enter image description here

3 Answers

For what it's worth, I'm not sure what causes this error either. It seems to be some combination of syntax or parsing error covered up by a less useful error.

For me,

  • checking whitespace
  • making sure there was a line-break between a comment block and the events block
  • switching from paths to paths-ignore

One of those things fixed it for me.

enter image description here

I got this error from a commit where I have only edited the workflow yaml file but nothing else. It was triggered normally after editing and commiting other files.

Related