languageservices icon indicating copy to clipboard operation
languageservices copied to clipboard

Make `jobs.<job_id>.steps` required in `job-factory`

Open muzimuzhi opened this issue 5 months ago • 0 comments

Fixes https://github.com/github/vscode-github-actions/issues/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 https://github.com/muzimuzhi/hello-github-actions/pull/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

muzimuzhi avatar Aug 27 '24 22:08 muzimuzhi