npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tree-sitter-gh-actions-expressions

v0.5.1

Published

Github Actions expressions grammar for tree-sitter

Readme

tree-sitter-gh-actions-expressions

CI discord matrix crates npm pypi

Tree-sitter grammar for Github Actions expressions

[!IMPORTANT] ABI version: 15

Parser requirements

  • gitignore (optional): for hashFiles() function
  • json (optional): for fromJSON() function
  • yaml: injection to its block_mapping_pair node. Check the yaml injection section for more information

Usage in Editors

Neovim

  • gh-actions.nvim: plugin that integrates this grammar to your Neovim configuration

Helix

WIP

Emacs

WIP

In General

You can get the built files from the release branch. If you have specific instructions for your editor, PR's are welcome.

Injection for yaml parser

Use the following query:

((block_mapping_pair
  key: (flow_node) @_key
  value: [
    (block_node
      (block_scalar) @_value)
    (flow_node
      [
        (plain_scalar
          (string_scalar) @_value)
        (double_quote_scalar) @_value
      ])
  ]
  (#match? @_value "${{")) @injection.content
  (#is-gh-actions-file? "") ; NOTE: NEW PREDICATE
  (#set! injection.language "gh_actions_expressions")
  (#set! injection.include-children))

((block_mapping_pair
  key: (flow_node) @_key
  (#eq? @_key "if")
  value: (flow_node
    (plain_scalar
      (string_scalar) @_value)
    (#not-match? @_value "${{"))) @injection.content
  (#is-gh-actions-file? "") ; NOTE: NEW PREDICATE
  (#set! injection.language "gh_actions_expressions")
  (#set! injection.include-children))

is-gh-actions-file predicate

To avoid injecting this grammar to files other than github actions, is recommended to create a predicate named is-gh-actions-file.

[!NOTE] The creation of this directive varies for each editor

This predicate will be the responsible to allow injection to files that matches the name pattern .github/workflows/*.ya?ml.

Implementations

gh-actions.nvim

Troubleshooting

AST errors within bash injections when using run key

AST error within bash injection

To avoid these errors, is recommended to surround the expression within a raw_string node, string with single quotes ', i.e.:

jobs:
  dry-run:
    name: dry-run
    runs-on: ubuntu-latest
    steps:
      - name: dry-run
        run: ./script.sh '${{ inputs.mode }}' --dry-run

Correct bash AST by using raw_string

What if I need it within a variable expansion?

AST error within variable expansion

Because variable expansion is done by using $ prefix, the ${{ and }} nodes will cause an AST error. To avoid, this declare an auxiliary bash variable or an environment variable:

jobs:
  dry-run:
    name: dry-run
    runs-on: ubuntu-latest
    steps:
      - name: dry-run
        run: |
          auxiliary_var='${{ inputs.mode }}'
          ./script.sh "$MY_VAR and $MODE" --dry-run
          ./script.sh "$MY_VAR and $auxiliary_var" --dry-run
        env:
          MODE: ${{ inputs.mode }}

Correct bash AST by using auxiliary variables

References

Thanks

Thanks to @disrupted for creating tree-sitter-github-actions grammar, which is the base I used to create this grammar.