11

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

Kevin ABRIOUX
  • 16,507
  • 12
  • 93
  • 99

4 Answers4

9

You can trigger all branches just by using

on: push

https://docs.github.com/en/actions/reference/events-that-trigger-workflows#example-using-a-single-event

Remove - '*'

Your workflow file seems fine. Have you checked all indentation.

Priebe
  • 4,942
  • 3
  • 24
  • 38
2

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.

Francisco Cardoso
  • 1,438
  • 15
  • 20
1

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

1

I got this error when I added to the .github/workflows folder a yamllint config yaml file. Because it was located in that folder, it was evaluated as a workflow file, but it actually wasn't (hence no trigger specified). I fixed it by moving the file out of that directory, to .github.

Iván
  • 66
  • 3