Skip to content

Conversation

@muzimuzhi
Copy link
Contributor

Fixes github/vscode-github-actions#291.

This PR makes steps property required by jobs that don't call reusable workflows.

The only non-test change is

--- a/workflow-parser/src/workflow-v1.0.json
+++ b/workflow-parser/src/workflow-v1.0.json
@@ -1700,7 +1700,10 @@
           "concurrency": "job-concurrency",
           "outputs": "job-outputs",
           "defaults": "job-defaults",
-          "steps": "steps"
+          "steps": {
+            "type": "steps",
+            "required": true
+          }
         }
       }
     },

Without steps, such jobs won't even run. It's shown in muzimuzhi/hello-github-actions#33 that triggering workflow file

on:
  push:
  workflow_dispatch: # optional
jobs:
  no-steps:
    runs-on: ubuntu-latest

would fail with

Invalid workflow file: .github/workflows/test-github-actions.yml#L1
No steps defined in `steps` and no workflow called in `uses` for the following jobs: no-steps

Copilot AI review requested due to automatic review settings December 23, 2025 12:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the steps property required for GitHub Actions jobs that use a runner (jobs with runs-on), aligning with GitHub Actions' actual validation behavior where jobs must have either steps defined or call a reusable workflow via uses.

Key changes:

  • Updated the workflow schema to make steps required for job-factory type jobs
  • Added a new test case to validate the error when steps is missing
  • Updated existing test cases to include steps where previously omitted

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
workflow-parser/src/workflow-v1.0.json Schema change making steps required for regular jobs (job-factory)
workflow-parser/testdata/reader/errors-job-runs-on-and-no-steps.yml New test file validating the missing steps error
workflow-parser/testdata/reader/errors-job-runs-on-and-uses.yml Updated test to include steps (problematic - see comment)
workflow-parser/src/model/convert.test.ts Updated test workflows to include steps and added new test case
languageservice/src/validate.test.ts Updated test workflows to include steps

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +8 to +9
steps:
- run: echo hello
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding steps to a job that uses a reusable workflow (with uses) is incorrect. Jobs that call reusable workflows should not have steps - they delegate execution to the called workflow. This test case is validating that runs-on and uses cannot coexist on the same job. Adding steps here creates a confusing test case with multiple simultaneous validation errors (runs-on + uses + steps), when the test should focus solely on the runs-on + uses conflict.

Suggested change
steps:
- run: echo hello

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lack of both steps and uses isn't flagged as an error

1 participant