Skip to content

Support case expression #6006

@wd-hopkins

Description

@wd-hopkins

Bug report info

act version: 0.2.84

Command used with act

act -W .github/workflows/test-expressions.yml -P ubuntu-latest=node:16-buster-slim

Describe issue

GitHub Actions expressions now support a case function which can perform true logical operations. https://github.blog/changelog/2026-01-29-github-actions-smarter-editing-clearer-debugging-and-a-new-case-function/

Link to GitHub repository

No response

Workflow content

name: example

on:
  push:

jobs:
  main:
    runs-on: ubuntu-latest
    env:
      TEST: ${{ case(github.event_name == 'workflow_dispatch', 'dispatch', 'other') }}
    steps:
      - name: Run a one-line script
        run: echo $TEST

Relevant log output

Error: workflow is not valid. 'test-expressions.yml': Line: 8 Column 5: Failed to match job-factory: Line: 10 Column 13: Unknown Function Call case
Line: 8 Column 5: Failed to match workflow-job: Line: 8 Column 5: Unknown Property runs-on
Line: 9 Column 5: Unknown Property env
Line: 11 Column 5: Unknown Property steps
Actions YAML Schema Validation Error detected:
For more information, see: https://nektosact.com/usage/schema.html
exit status 1

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions