github / vscode-github-actions

GitHub Actions extension for VS Code
https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-github-actions
MIT License
476 stars 72 forks source link

Lack of steps isn't flagged as an error #291

Open jsoref opened 6 months ago

jsoref commented 6 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. With this workflow csharp-qltest.yml:
    
    name: "C#: Run QL Tests"

on: push: paths:

defaults: run: working-directory: csharp

jobs: qlupgrade: runs-on: ubuntu-latest steps:

  1. Look at the choose-runner job

Expected behavior

According to GitHub, this job isn't valid: https://github.com/jsoref/codeql/actions/runs/7712430252

Invalid workflow file: .github/workflows/csharp-qltest.yml#L1 No steps defined in steps and no workflow called in uses for the following jobs: choose-runner

Generally if a workflow isn't valid, this extension will complain, e.g. if I add just steps::

image image

Screenshots Invalid workflow file: .github/workflows/csharp-qltest.yml#L1 No steps defined in steps and no workflow called in uses for the following jobs: choose-runner

Extension Version v0.26.2

Additional context

muzimuzhi commented 6 months ago

actionlint (https://github.com/rhysd/actionlint) does a good job in detecting empty steps, see here.

There's also a VScode extension for actionlint (I didn't use it myself): https://marketplace.visualstudio.com/items?itemName=arahata.linter-actionlint.