Identifiersflags: g

GitHub Actions Expression

Match `${{ expression }}` interpolations used in GitHub Actions workflow YAML.

Try it in RegexPro →

Available in

Pattern

regexengine-agnostic
\$\{\{\s*([^}]+?)\s*\}\}   (flags: g)

Raw source: \$\{\{\s*([^}]+?)\s*\}\}

How it works

\$\{\{ matches the literal `${{`. \s*([^}]+?)\s* lazily captures the inner expression (with surrounding whitespace stripped). \}\} matches the closing `}}`. The lazy quantifier prevents accidentally consuming through to a later `}}` in the same line.

Examples

Input

if: ${{ github.actor == 'octocat' }}

Matches

  • ${{ github.actor == 'octocat' }}

Input

run: echo ${{ secrets.NPM_TOKEN }} | npm publish

Matches

  • ${{ secrets.NPM_TOKEN }}

Input

no expressions

No match

Common use cases

  • Linting workflow files for unsafe expressions
  • Detecting committed secret references
  • Migrating between GitHub Actions and other CI providers
  • Documentation generation from workflow YAML

Related patterns