Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required property is missing: shell #378

Open
garysassano opened this issue Aug 20, 2024 · 7 comments
Open

Required property is missing: shell #378

garysassano opened this issue Aug 20, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@garysassano
Copy link

garysassano commented Aug 20, 2024

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:

  • run property is used
  • shell property is not specified

Extension Version
v0.26.3

@muzimuzhi
Copy link

muzimuzhi commented Aug 20, 2024

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.

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.

@garysassano
Copy link
Author

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.

@muzimuzhi
Copy link

@garysassano You might overlooked the last sentence in my quote: "Required if run is set."

@garysassano
Copy link
Author

@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.

@muzimuzhi
Copy link

muzimuzhi commented Aug 20, 2024

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.

@muzimuzhi
Copy link

muzimuzhi commented Aug 20, 2024

@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:
image
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 #75 (comment) and #75 (comment).

@garysassano
Copy link
Author

I had to uninstall that extension since it was giving me issues with CloudFormation and other stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog 🗒
Development

No branches or pull requests

2 participants