Skip to main content

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.

✓ 60K+ developers trust DevPlaybook ✓ All GitHub Actions functions ✓ Runs 100% in your browser

Example Expressions

Mock Context Variables

Edit values to match your scenario, then evaluate.

github.event_name
github.ref
github.ref_name
github.actor
github.sha
github.repository
inputs.environment
github.event.pull_request.draft
github.event.pull_request.base.ref

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.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Related Articles

Mar 24, 2026 · 12 min read

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.

Apr 2, 2026 · 15 min read

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.

Apr 1, 2026 · 16 min read

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.

Mar 28, 2026 · 16 min read

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.

Mar 27, 2026 · 14 min read

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.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$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.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →