[GH-ISSUE #2414] act should validate schema in a way that is close to what github does #1109

Closed
opened 2026-03-01 21:48:58 +03:00 by kerem · 1 comment
Owner

Originally created by @focusaurus on GitHub (Aug 2, 2024).
Original GitHub issue: https://github.com/nektos/act/issues/2414

Act version

act version 0.2.64

Feature description

act should run the workflow yaml through a schema validation pass and catch schema-level issues early.

My Example

I made an error in my workflow and had:

jobs:
  my-job:
    contents: write

I was missing a parent permissions.contents node.

Actual behavior act ran the workflow whereas github immediately showed an error:

The workflow is not valid. .github/workflows/example.yml (Line: 12, Col: 5): Unexpected value 'contents'

Desired behavior should be able to get similar error from act without running the workflow.

Originally created by @focusaurus on GitHub (Aug 2, 2024). Original GitHub issue: https://github.com/nektos/act/issues/2414 ### Act version act version 0.2.64 ### Feature description act should run the workflow yaml through a schema validation pass and catch schema-level issues early. ## My Example I made an error in my workflow and had: ```yml jobs: my-job: contents: write ``` I was missing a parent `permissions.contents` node. **Actual behavior** act ran the workflow whereas github immediately showed an error: ```The workflow is not valid. .github/workflows/example.yml (Line: 12, Col: 5): Unexpected value 'contents'``` **Desired behavior** should be able to get similar error from `act` without running the workflow.
kerem 2026-03-01 21:48:58 +03:00
Author
Owner

@ChristopherHX commented on GitHub (Aug 2, 2024):

Getting an official schema is the easy part https://github.com/actions/languageservices/blob/main/workflow-parser/src/workflow-v1.0.json

Another actions emulator I maintain uses the official .net template engine to apply the schema, but here we would need to either transform that schema / implement code that verifies it.

for action.yml it is in actions/runner

<!-- gh-comment-id:2265801642 --> @ChristopherHX commented on GitHub (Aug 2, 2024): Getting an official schema is the easy part https://github.com/actions/languageservices/blob/main/workflow-parser/src/workflow-v1.0.json Another actions emulator I maintain uses the official .net template engine to apply the schema, but here we would need to either transform that schema / implement code that verifies it. for action.yml it is in actions/runner
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1109
No description provided.