Github 指定推送分支时出现操作作业错误

Github action jobs error when push branch is specified

我正在尝试在 develop 分支上触发我的管道。

此代码有效:

name: develop

on: [push]
  jobs:
    build:

      runs-on: ubuntu-latest

      steps:
      - uses: actions/checkout@v1
      - name: set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8
      - name: Build Debug version
        run: |
            chmod +x pipelines.sh
            ./pipelines.sh "build"

此代码无效:

name: develop

on: 
  push:
    branches:    
      - 'develop'
  jobs:
    build:

      runs-on: ubuntu-latest

      steps:
      - uses: actions/checkout@v1
      - name: set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8
      - name: Build Debug version
        run: |
            chmod +x pipelines.sh
            ./pipelines.sh "build"

我总是收到此错误消息:

jobs is not a valid event name

我必须如何格式化我的文件才能使其正常工作?

jobs 应与 on 处于同一级别且无缩进。

on: 
  push:
    branches:    
      - 'develop'
jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
    - name: Build Debug version
      run: |
          chmod +x pipelines.sh
          ./pipelines.sh "build"