`Required property is missing: shell`
Describe the bug
The VS Code extension lacks critical linting support. Specifically, when creating a Composite Action, it fails to provide a warning that a shell property is required. I only became aware of this after pushing an update and encountering the following error:
.github/actions/aws-config/action.yml (Line: 18, Col: 7): Required property is missing: shell
Expected behavior The VS Code extension should display a warning when authoring a Composite Action for each step that meets the following conditions:
-
runproperty is used -
shellproperty is not specified
Extension Version
v0.26.3
Background info:
Optional The shell where you want to run the command. You can use any of the shells listed in "Workflow syntax for GitHub Actions." Required if
runis set.
Update: So according to the doc for runs for composite actions, runs.steps[*].shell is required if runs.steps[*].shell is set in the same step, otherwise optional.
Background info:
runs.steps[*].shell Optional The shell where you want to run the command. You can use any of the shells listed in "Workflow syntax for GitHub Actions." Required if run is set.
THIS is the correct docs you should reference to. The shell property is REQUIRED for Composite Actions.
@garysassano You might overlooked the last sentence in my quote: "Required if run is set."
@muzimuzhi I still don't see how your message solves the issue? If you are inside a Composite Action and you create a step with run property but without shell property, the VS Code extension doesn't warn you about it.
I still don't see how your message solves the issue?
It doesn't. I just quoted the relevant doc which supports what you reported and perhaps gives more detailed info about when shell is required.
@garysassano As a workaround, you can try extension redhat.vscode-yaml which uses schemas from https://www.schemastore.org/json/ to validate both workflows and composite actions.
It's default setting is already capable at catching the missing property shell error:
The action in screenshot above is
.github/actions/unique-id/action.yml in muzimuzhi/hello-github-actions repo.
PS: redhat.vscode-yaml extension is also used to work around #75, see https://github.com/github/vscode-github-actions/issues/75#issuecomment-1490722860 and https://github.com/github/vscode-github-actions/issues/75#issuecomment-1736463114.
I had to uninstall that extension since it was giving me issues with CloudFormation and other stuff.