Summary
gh aw validate rejects the typed and untyped activity types of the issues event. GitHub supports them, and gh aw compile accepts them. Only validation fails.
Reproduction
Frontmatter:
on:
issues:
types: [opened, reopened, typed]
gh aw compile succeeds. gh aw validate fails:
error: invalid workflow: GitHub Actions schema validation failed:
jsonschema validation failed with 'https://json.schemastore.org/github-workflow.json#'
- at '/on': 'oneOf' failed, none matched
- at '/on/issues/types/2': value must be one of 'opened', 'edited', 'deleted',
'transferred', 'pinned', 'unpinned', 'closed', 'reopened', 'assigned',
'unassigned', 'labeled', 'unlabeled', 'locked', 'unlocked', 'milestoned',
'demilestoned'
The compiled lock file is correct, and GitHub runs the workflow as expected. strict: false does not change the result.
Cause
pkg/workflow/schemas/github-workflow.json comes from SchemaStore, whose list of issues activity types stops at demilestoned. GitHub documents four more:
typed, untyped, field_added, field_removed
ref: https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#issues
typed and untyped came with Issue Types. They are the only way to start a workflow when a user sets or removes the type of an issue. This matters for triage workflows that act on one type: an issue that gets its type after creation never triggers on opened.
I confirmed the four values are absent from the vendored schema in v0.85.4, v0.86.2 and main. They are also absent from SchemaStore master, so a re-download does not fix it.
Suggested fix
The Makefile already has a target for keys that SchemaStore does not carry:
patch-github-actions-schema:
@tmpfile=$$(mktemp) && \
jq '.definitions["permissions-event"].properties += {"copilot-requests": ..., "vulnerability-alerts": ...}' \
pkg/workflow/schemas/github-workflow.json > "$$tmpfile" && \
mv "$$tmpfile" pkg/workflow/schemas/github-workflow.json
Please extend that same target to append the missing activity types to the issues block. Both the enum and the identical default list need the change.
Workaround
We removed the affected workflow from gh aw validate in CI. gh aw compile still covers it.
Upstream
I reported the root cause to SchemaStore: SchemaStore/schemastore#6211
A patch here would not need to wait for that to land, in the same way the permissions-event patch does not wait for SchemaStore/schemastore#6175.
Summary
gh aw validaterejects thetypedanduntypedactivity types of theissuesevent. GitHub supports them, andgh aw compileaccepts them. Only validation fails.Reproduction
Frontmatter:
gh aw compilesucceeds.gh aw validatefails:The compiled lock file is correct, and GitHub runs the workflow as expected.
strict: falsedoes not change the result.Cause
pkg/workflow/schemas/github-workflow.jsoncomes from SchemaStore, whose list ofissuesactivity types stops atdemilestoned. GitHub documents four more:typed,untyped,field_added,field_removedref: https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#issues
typedanduntypedcame with Issue Types. They are the only way to start a workflow when a user sets or removes the type of an issue. This matters for triage workflows that act on one type: an issue that gets its type after creation never triggers onopened.I confirmed the four values are absent from the vendored schema in
v0.85.4,v0.86.2andmain. They are also absent from SchemaStoremaster, so a re-download does not fix it.Suggested fix
The
Makefilealready has a target for keys that SchemaStore does not carry:Please extend that same target to append the missing activity types to the
issuesblock. Both theenumand the identicaldefaultlist need the change.Workaround
We removed the affected workflow from
gh aw validatein CI.gh aw compilestill covers it.Upstream
I reported the root cause to SchemaStore: SchemaStore/schemastore#6211
A patch here would not need to wait for that to land, in the same way the
permissions-eventpatch does not wait for SchemaStore/schemastore#6175.