首页 > 解决方案 > Github action `on` 中没有定义事件触发器

问题描述

我创建了一个管道,我想在每次推送任何分支时触发

有我的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

当我在github上推送这个时,我有这个错误

中未定义事件触发器on

在此处输入图像描述

标签: githubyamlpipelinegithub-actions

解决方案


您只需使用即可触发所有分支

on: push

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

消除 - '*'

您的工作流程文件似乎很好。你检查了所有的缩进。


推荐阅读