GitHub Actions Expression Evaluator
Test ${{ }} expressions with custom contexts — preview results before pushing, nothing sent to any server
Expression
${{ github.ref == 'refs/heads/main' }}Quick Fill
Expression Examples
Mock Context
Supported Functions Reference
contains(search, item)Check if array/string contains itemstartsWith(str, prefix)Check string prefix (case-insensitive)endsWith(str, suffix)Check string suffix (case-insensitive)format(str, ...args)Format string with {0}, {1} placeholdersjoin(arr, sep?)Join array elements with separatortoJSON(value)Convert value to JSON stringfromJSON(str)Parse JSON string to objecthashFiles(paths...)Mock hash of file pathssuccess()True if job status is successfailure()True if job status is failurecancelled()True if job was cancelledalways()Always returns trueGitHub Actions expressions (${{ }}) control conditional steps, set outputs, and format strings in your workflows. But testing them requires pushing code and waiting for a workflow run. This tool lets you evaluate expressions locally with custom context values — so you can verify your if: conditions, string functions, and status checks before committing.
What You Can Evaluate
The evaluator supports the full GitHub Actions expression syntax:
- Literals —
true,false,null, numbers, strings - Operators —
==,!=,&&,||,!,<,>,<=,>= - Functions —
contains(),startsWith(),endsWith(),format(),join(),toJSON(),fromJSON(),hashFiles()(simulated) - Status functions —
success(),failure(),cancelled(),always() - Context access —
github.event_name,env.MY_VAR,steps.build.outputs.result,matrix.os
Setting Up Contexts
Define custom context values in JSON format to simulate different scenarios:
{
"github": {
"event_name": "pull_request",
"ref": "refs/heads/feature/login",
"actor": "octocat"
},
"env": {
"NODE_ENV": "production",
"DEPLOY_TARGET": "staging"
},
"steps": {
"build": {
"outputs": { "result": "success" },
"outcome": "success"
}
}
}
Then test expressions like:
github.event_name == 'push'→falsecontains(github.ref, 'feature/')→truesteps.build.outputs.result == 'success' && env.NODE_ENV == 'production'→true
How to Use
- Enter your expression in the expression input (without the
${{ }}wrapper) - Define context values as JSON in the context panel
- See the evaluated result instantly
- Adjust contexts to test different scenarios
Frequently Asked Questions
Does it support the hashFiles() function?
hashFiles() is simulated — it returns a deterministic hash based on the input string. In real GitHub Actions, it hashes actual file contents from the repository.
Can I test matrix expressions?
Yes. Define a matrix object in your context JSON (e.g., {"matrix": {"os": "ubuntu-latest", "node": 18}}) and reference it as matrix.os or matrix.node.
How do status functions work here?
You can set step outcomes in the context (steps.stepId.outcome) and the status functions will evaluate based on those values. always() always returns true.
Is my expression sent to a server? No. All evaluation runs in your browser using a JavaScript expression parser. No data leaves your device.
What’s the difference between this and the GitHub Actions Validator? The validator checks your entire workflow YAML for structural correctness. This tool focuses on evaluating individual expressions against custom context data.