GitHub Actions Expression Tester
Test $[object Object] expressions with mock GitHub Actions context variables. Catch logic errors before committing. Supports all built-in functions: contains, startsWith, fromJSON, and more.
Example Expressions
Mock Context Variables
Edit values to match your scenario, then evaluate.
Built-in Functions Reference
contains(s, v) String/array contains value. Case-insensitive for strings.
startsWith(s, prefix) String starts with prefix. Case-insensitive.
endsWith(s, suffix) String ends with suffix. Case-insensitive.
fromJSON(s) Parse JSON string to object/array.
toJSON(v) Serialize value to JSON string.
success() / failure() Job status check functions for step conditions.
cancelled() Returns true if job was cancelled.
format(str, r0, r1…) Replaces 0, 1… with arguments.
join(arr, sep) Joins array to string with separator.
Frequently Asked Questions
What is a GitHub Actions expression?▼
GitHub Actions expressions use the ${{ }} syntax to dynamically compute values in workflow files. They can reference context variables (github, env, secrets, inputs), call built-in functions (contains, startsWith, toJSON, etc.), and perform boolean/comparison logic to conditionally run steps or set output values.
What context variables are available?▼
Common contexts include: github (event_name, ref, sha, actor, repository), env (custom environment variables), inputs (workflow_dispatch inputs), secrets (encrypted secrets), needs (outputs from dependent jobs), and matrix (current matrix values). Each context is a JSON object accessible in expressions.
How does the 'contains' function work?▼
contains(haystack, needle) returns true if the string or array contains the value. Examples: contains('hello world', 'hello') → true. contains(github.event.labels.*.name, 'bug') → true if any label is named 'bug'. It's case-insensitive for strings.
What is the difference between == and startsWith?▼
== is strict equality: github.ref == 'refs/heads/main' is true only for exact match. startsWith(str, prefix) checks if a string begins with the prefix — useful for branch patterns like startsWith(github.ref, 'refs/heads/release/').
How do I run a step only on the main branch?▼
Use: if: github.ref == 'refs/heads/main'. For multiple branches: if: contains(fromJSON('["refs/heads/main","refs/heads/develop"]'), github.ref). For PR events targeting main: if: github.event.pull_request.base.ref == 'main'.
What does fromJSON do?▼
fromJSON(value) parses a JSON string into an object. It's commonly used to convert string-encoded matrix values or to compare against arrays. For example: contains(fromJSON('["push","pull_request"]'), github.event_name) checks if the event is a push or pull_request.
Related Products
on GumroadGitHub Actions CI/CD Templates Pack
12 production-ready GitHub Actions workflow templates covering Node.js, Python, Docker, multi-environment deployments, security scanning, and auto-changelog. Copy, paste, ship.
Buy on Gumroad →Premium Workflow Pack
Production-grade workflows, architecture guides, and deployment scripts for teams that ship. 10 advanced CI/CD workflows (blue-green, canary, E2E, security), 5 architecture deep-dives, code review checklist, PR process guide, and 5 battle-tested Bash deployment scripts.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
GitHub Actions Workflow Generator
Generate GitHub Actions YAML workflows instantly. Choose triggers (push, PR, schedule), runtime (Node.js, Python, Go, Rust), and jobs (test, lint, build, Docker, GitHub Pages). Copy-ready .github/work
Open free tool →
GitHub Actions YAML Linter
Lint your GitHub Actions workflow YAML before pushing. Catches broken needs references, invalid trigger events, hardcoded secrets, unversioned action pins, and YAML syntax errors. Free browser tool.
Open free tool →
GitHub Actions Workflow Validator
Validate your GitHub Actions workflow YAML. Checks structure, trigger events, job dependencies, action version pins, hardcoded secrets, and cron expressions. Free, runs in your browser.
Open free tool →
More Free Tools
Related Articles
GitHub Actions Complete Guide: Build Your First CI/CD Pipeline in 2026
Learn GitHub Actions from scratch. Set up automated testing, linting, Docker builds, and deployments with real workflow examples. No prior CI/CD experience needed.
DevOps Automation Tools in 2026: Orchestrating the Software Delivery Pipeline
Master DevOps automation with this guide to the tools that orchestrate modern software delivery. Covers CI/CD pipelines, infrastructure provisioning, configuration management, testing automation, and the emerging AI-assisted automation patterns that define 2026.
GitHub Actions Advanced Guide 2026: Matrix Builds, Caching, OIDC & Cost Optimization
Master GitHub Actions in 2026. Deep-dive into matrix strategies, artifact caching, OIDC authentication with AWS/GCP/Azure, self-hosted runners, reusable workflows, and cost optimization techniques for fast, cheap CI/CD pipelines.
AI-Assisted Code Review Workflow: A Complete Guide for 2026
Learn how to build a production-ready AI-assisted code review workflow using Claude, GitHub Actions, and modern dev tools. Covers setup, prompts, integration patterns, and real-world best practices.
Dagger vs GitHub Actions vs Jenkins: Modern CI/CD Pipeline Comparison 2026
Compare Dagger, GitHub Actions, and Jenkins for CI/CD in 2026. Real-world benchmarks, architecture differences, pricing, and a recommendation matrix to pick the right tool.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →