GitHub Actions: Smarter editing, clearer debugging, and a new case function
We’ve shipped several improvements to GitHub Actions that make it easier to write, validate, and troubleshoot workflow logic, especially when you rely on if: conditionals to control what runs.
Here are some of the new improvements:
- A new
casefunction for more expressive conditional logic - Expanded expression logs so you can see why jobs get skipped.
- Better workflow authoring across VS Code, web editor, and other IDEs
- Editor support for
action.ymlfiles - Better
if:condition handling
Write more expressive expressions with a case function
GitHub Actions expressions now support a case function which can perform true logical operations, similar to a case expression in SQL. This lets you handle many different types of logical operations including if-else, if-else if, if-else if-else and even switch-case. This function also uses booleans so it avoids the limitations of current workarounds. You can find more information about the case function in the expressions documentation.
Understand why jobs get skipped
When a job is skipped because of an if: conditional, you can now see exactly why. The job logs show the original expression alongside an expanded version with all values from contexts at runtime. You can find details on how to access these logs in the job condition logs documentation.
Better workflow authoring across editors
We’ve brought the enhanced workflow authoring experience from the GitHub Actions VS Code extension to the web editor and other IDEs. Improvements include:
- Smarter autocomplete: Context-aware completions for expressions, event payloads,
needsoutputs, andmatrixvalues. - Expression validation: Catches invalid context access, unrecognized functions, and literal text in
ifconditions. - Hover documentation: View function signatures and context descriptions inline.
- Standalone binary: Use the language service in NeoVim, Emacs, Sublime, or other editors.
- Plus inline cron schedule hints, smarter syntax completions, and more.
Editor support for action.yml files
Action authors now get the same editing experience as workflow authors. When you open an action.yml file in VS Code, the web editor, or any editor using the standalone binary, you’ll get:
- Autocomplete for action metadata fields (
name,description,inputs,outputs,runs, etc.). - Context-aware
runscompletions that filter based on your action type (Node.js, composite, or Docker). - Validation for schema compliance, required fields, and expressions.
- Scaffolding snippets to quickly bootstrap new actions.
Better if: condition handling
We’ve added improvements to catch common pitfalls with if: conditions and other workflow fields. Specifically:
ifconditions with text outside the${{ }}markers, which makes the whole expression a string (always truthy). This will be caught by editor validation in VS Code and the web editor, and produces an annotation on the workflow run.- Invalid
formatstrings. This will also be caught by the editor validation. - Trailing newlines will automatically be trimmed.
What this means in practice
- Fewer surprise jobs and steps from always-truthy strings.
- Earlier feedback on malformed conditions.
From authoring to debugging, your workflow experience just got smoother.
Join the discussion within GitHub Community.