Skip to content

Runner v2.333.0 breaks case function #4315

@codello

Description

@codello

Describe the bug

The GitHub runner version 2.333.0 reports an error when the case function is used for default values in composite actions. The error message is Unrecognized function: 'case'. This error occurs only for 2.333.0, in 2.332.0 the same actions work without issues.

To Reproduce
Steps to reproduce the behavior:

  1. Create a composite action that uses the case function in the default value for an input. For example
    name: Test Action
    
    inputs:
      test:
        default: ${{ case(github.event_name == 'push', 'bar', 'baz') }}
        description: "This input uses `case` in its default value."
    
    runs:
      using: composite
      steps:
        - shell: bash
          run: ":"
  2. Create a workflow that uses the action without supplying a value for the test input:
    on: push
    
    jobs:
      create:
        runs-on: ubuntu-slim
        steps:
          - uses: actions/checkout@v6
          - uses: ./my-action
  3. See that the workflow fails to call ./my-action with an error message of Unrecognized function: 'case'.

Expected behavior

I expect the action to be called successfully. In the example case I expect the default value of the test input to evaluate to 'bar'.

Runner Version and Platform

Version of your runner?
2.333.0

OS of the machine running the runner? OSX/Windows/Linux/...

- OS: Linux (x64)
- Source: Docker
- Name: ubuntu:24.04
- Version: 20260323.53.1

The example is running on GitHub-hosted runners.

What's not working?

The full error message is

Error: The template is not valid. /home/runner/work/broken-case-function/broken-case-function/./my-action/action.yml (Line: 5, Col: 14): Unrecognized function: 'case'. Located at position 1 within expression: case(github.event_name == 'push', 'bar', 'baz')

I have created a repository for reproduction at https://github.com/codello/broken-case-function. An example run of the workflow above (including the error) can be found at https://github.com/codello/broken-case-function/actions/runs/23610377699/job/68764200008

Job Log Output

Debug log output of the step
##[debug]Evaluating condition for step: 'Run ./my-action'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Run ./my-action
Prepare all required actions
##[debug]Loading inputs
##[debug]/home/runner/work/broken-case-function/broken-case-function/./my-action/action.yml (Line: 5, Col: 14):
Error: The template is not valid. /home/runner/work/broken-case-function/broken-case-function/./my-action/action.yml (Line: 5, Col: 14): Unrecognized function: 'case'. Located at position 1 within expression: case(github.event_name == 'push', 'bar', 'baz')
##[debug]GitHub.DistributedTask.ObjectTemplating.TemplateValidationException: The template is not valid. /home/runner/work/broken-case-function/broken-case-function/./my-action/action.yml (Line: 5, Col: 14): Unrecognized function: 'case'. Located at position 1 within expression: case(github.event_name == 'push', 'bar', 'baz')
##[debug]   at GitHub.DistributedTask.ObjectTemplating.TemplateValidationErrors.Check()
##[debug]   at GitHub.Runner.Worker.ActionManifestManagerLegacy.EvaluateDefaultInput(IExecutionContext executionContext, String inputName, TemplateToken token)
##[debug]   at GitHub.Runner.Worker.ActionManifestManagerWrapper.<>c__DisplayClass7_0.<EvaluateDefaultInput>b__0()
##[debug]   at GitHub.Runner.Worker.ActionManifestManagerWrapper.EvaluateAndCompare[TLegacy,TNew](IExecutionContext context, String methodName, Func`1 legacyEvaluator, Func`1 newEvaluator, Func`3 resultComparer)
##[debug]   at GitHub.Runner.Worker.ActionManifestManagerWrapper.EvaluateDefaultInput(IExecutionContext executionContext, String inputName, TemplateToken token)
##[debug]   at GitHub.Runner.Worker.ActionRunner.RunAsync()
##[debug]   at GitHub.Runner.Worker.StepsRunner.RunStepAsync(IStep step, CancellationToken jobCancellationToken)
##[debug]Finishing: Run ./my-action

Describe the bug

The GitHub runner version 2.333.0 reports an error when the case function is used for default values in composite actions. The error message is Unrecognized function: 'case'. This error occurs only for 2.333.0, in 2.332.0 the same actions work without issues.

To Reproduce
Steps to reproduce the behavior:

  1. Create a composite action that uses the case function in the default value for an input. For example
    name: Test Action
    
    inputs:
      test:
        default: ${{ case(github.event_name == 'push', 'bar', 'baz') }}
        description: "This input uses `case` in its default value."
    
    runs:
      using: composite
      steps:
        - shell: bash
          run: ":"
  2. Create a workflow that uses the action without supplying a value for the test input:
    on: push
    
    jobs:
      create:
        runs-on: ubuntu-slim
        steps:
          - uses: actions/checkout@v6
          - uses: ./my-action
  3. See that the workflow fails to call ./my-action with an error message of Unrecognized function: 'case'.

Expected behavior

I expect the action to be called successfully. In the example case I expect the default value of the test input to evaluate to 'bar'.

Runner Version and Platform

Version of your runner?
2.333.0

OS of the machine running the runner? OSX/Windows/Linux/...

- OS: Linux (x64)
- Source: Docker
- Name: ubuntu:24.04
- Version: 20260323.53.1

The example is running on GitHub-hosted runners.

What's not working?

The full error message is

Error: The template is not valid. /home/runner/work/broken-case-function/broken-case-function/./my-action/action.yml (Line: 5, Col: 14): Unrecognized function: 'case'. Located at position 1 within expression: case(github.event_name == 'push', 'bar', 'baz')

I have created a repository for reproduction at https://github.com/codello/broken-case-function. An example run of the workflow above (including the error) can be found at https://github.com/codello/broken-case-function/actions/runs/23610377699/job/68764200008

Job Log Output

Debug log output of the step
##[debug]Evaluating condition for step: 'Run ./my-action'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Run ./my-action
Prepare all required actions
##[debug]Loading inputs
##[debug]/home/runner/work/broken-case-function/broken-case-function/./my-action/action.yml (Line: 5, Col: 14):
Error: The template is not valid. /home/runner/work/broken-case-function/broken-case-function/./my-action/action.yml (Line: 5, Col: 14): Unrecognized function: 'case'. Located at position 1 within expression: case(github.event_name == 'push', 'bar', 'baz')
##[debug]GitHub.DistributedTask.ObjectTemplating.TemplateValidationException: The template is not valid. /home/runner/work/broken-case-function/broken-case-function/./my-action/action.yml (Line: 5, Col: 14): Unrecognized function: 'case'. Located at position 1 within expression: case(github.event_name == 'push', 'bar', 'baz')
##[debug]   at GitHub.DistributedTask.ObjectTemplating.TemplateValidationErrors.Check()
##[debug]   at GitHub.Runner.Worker.ActionManifestManagerLegacy.EvaluateDefaultInput(IExecutionContext executionContext, String inputName, TemplateToken token)
##[debug]   at GitHub.Runner.Worker.ActionManifestManagerWrapper.<>c__DisplayClass7_0.<EvaluateDefaultInput>b__0()
##[debug]   at GitHub.Runner.Worker.ActionManifestManagerWrapper.EvaluateAndCompare[TLegacy,TNew](IExecutionContext context, String methodName, Func`1 legacyEvaluator, Func`1 newEvaluator, Func`3 resultComparer)
##[debug]   at GitHub.Runner.Worker.ActionManifestManagerWrapper.EvaluateDefaultInput(IExecutionContext executionContext, String inputName, TemplateToken token)
##[debug]   at GitHub.Runner.Worker.ActionRunner.RunAsync()
##[debug]   at GitHub.Runner.Worker.StepsRunner.RunStepAsync(IStep step, CancellationToken jobCancellationToken)
##[debug]Finishing: Run ./my-action

Runner and Worker's Diagnostic Logs

Here is the log archive from GitHub Actions: logs_62197128874.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions