Make jobs.<job_id>.steps required in job-factory#98
Make jobs.<job_id>.steps required in job-factory#98muzimuzhi wants to merge 3 commits intoactions:mainfrom
jobs.<job_id>.steps required in job-factory#98Conversation
There was a problem hiding this comment.
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
stepsrequired forjob-factorytype jobs - Added a new test case to validate the error when
stepsis missing - Updated existing test cases to include
stepswhere 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.
| steps: | ||
| - run: echo hello |
There was a problem hiding this comment.
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.
| steps: | |
| - run: echo hello |
Fixes github/vscode-github-actions#291.
This PR makes
stepsproperty required by jobs that don't call reusable workflows.The only non-test change is
Without
steps, such jobs won't even run. It's shown in muzimuzhi/hello-github-actions#33 that triggering workflow filewould fail with