Skip to content

Workflow fails to parse when 'star' and 'workflow_dispatch' triggers are combined: Unexpected value 'star' #4611

Description

@xbsheng

Describe the bug

A workflow declaring both star and workflow_dispatch triggers fails to parse with:

failed to parse workflow: (Line: 3, Col: 3): Unexpected value 'star'

Each trigger alone parses fine. The combination fails regardless of order and regardless of whether types is specified.

Minimal repro

name: repro
on:
  star:
    types: [created]
  workflow_dispatch:
jobs:
  t:
    runs-on: ubuntu-latest
    steps:
      - run: echo hi

Attempting to dispatch it:

$ gh workflow run repro.yml
HTTP 422: Invalid Argument - failed to parse workflow: (Line: 3, Col: 3): Unexpected value 'star'

Test matrix (all verified against github.com via the dispatch API):

triggers result
star: with types: [created], alone parses
workflow_dispatch:, alone parses
star: + fork: parses
push: + workflow_dispatch: parses
star: + workflow_dispatch: fails
workflow_dispatch: then star: (reversed) fails
star: (no types) + workflow_dispatch: fails

Expected behavior: both triggers are valid events individually, so the combination should parse like any other event combination.

Workaround: use watch: types: [started] instead of star (starring a repository fires the watch event with action: started). This parses and works correctly.

Environment: github.com; workflow first added to the default branch also shows a failed run (0s, no jobs, listed by file path) for the push that added it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions