# tree-sitter-ghactions
Github Actions expressions grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter)
## Features
* Parses Github Action's expressions: `${{ ... }}`
* Plays well with `bash` injections in YAML documents
* Passes parsing tests from [actionlint](https://github.com/rhysd/actionlint)
## Neovim Installation (for use in your editor)
1. Install [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter/tree/main)
It is recommended to install at least `yaml`, `bash`, and `comment` parsers to support github actions files.
2. Configure autocmd for a custom parser:
```lua
-- custom parsers
vim.api.nvim_create_autocmd('User', {
pattern = 'TSUpdate',
callback = function()
require('nvim-treesitter.parsers').ghactions = {
install_info = {
url = 'https://github.com/rmuir/tree-sitter-ghactions',
queries = 'queries',
},
}
end,
})
```
3. Configure yaml injection in `~/.config/nvim/queries/yaml/injections.scm`:
```tsq
; extends
; github actions
([
(string_scalar)
(block_scalar)
(double_quote_scalar)
(single_quote_scalar)
] @injection.content
(#lua-match? @injection.content "[$]{{.*}}")
(#set! injection.language "ghactions"))
```
4. Run `:TSUpdate` and `:TSInstall ghactions` from neovim.
NOTE: these instructions are based upon the `main` branch of `nvim-treesitter`.
## Bindings Installation (for development)
Bindings are published to `pypi`, `npm`, and `crates.io` as `tree-sitter-ghactions`.
Wasm and source code artifacts are published to [GitHub releases](https://github.com/rmuir/tree-sitter-ghactions/releases)
## Screenshot of highlights

Raw data
{
"_id": null,
"home_page": null,
"name": "tree-sitter-ghactions",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "incremental, parsing, tree-sitter, github, actions",
"author": null,
"author_email": "Robert Muir <rmuir@apache.org>",
"download_url": "https://files.pythonhosted.org/packages/b1/d5/22d5c0af87f8322849b29028f9fe9df7174f6ae0edeb8b3df17f03956920/tree_sitter_ghactions-0.2.1.tar.gz",
"platform": null,
"description": "# tree-sitter-ghactions\n\nGithub Actions expressions grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter)\n\n## Features\n\n* Parses Github Action's expressions: `${{ ... }}`\n* Plays well with `bash` injections in YAML documents\n* Passes parsing tests from [actionlint](https://github.com/rhysd/actionlint)\n\n## Neovim Installation (for use in your editor)\n\n1. Install [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter/tree/main)\n\nIt is recommended to install at least `yaml`, `bash`, and `comment` parsers to support github actions files.\n\n2. Configure autocmd for a custom parser:\n \n```lua\n-- custom parsers\nvim.api.nvim_create_autocmd('User', {\n pattern = 'TSUpdate',\n callback = function()\n require('nvim-treesitter.parsers').ghactions = {\n install_info = {\n url = 'https://github.com/rmuir/tree-sitter-ghactions',\n queries = 'queries',\n },\n }\n end,\n})\n```\n\n3. Configure yaml injection in `~/.config/nvim/queries/yaml/injections.scm`:\n```tsq\n; extends\n\n; github actions\n([\n (string_scalar)\n (block_scalar)\n (double_quote_scalar)\n (single_quote_scalar)\n] @injection.content\n (#lua-match? @injection.content \"[$]{{.*}}\")\n (#set! injection.language \"ghactions\"))\n```\n\n4. Run `:TSUpdate` and `:TSInstall ghactions` from neovim.\n\nNOTE: these instructions are based upon the `main` branch of `nvim-treesitter`.\n\n## Bindings Installation (for development)\n\nBindings are published to `pypi`, `npm`, and `crates.io` as `tree-sitter-ghactions`.\nWasm and source code artifacts are published to [GitHub releases](https://github.com/rmuir/tree-sitter-ghactions/releases)\n\n## Screenshot of highlights\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Parser for Github Actions expressions",
"version": "0.2.1",
"project_urls": {
"Homepage": "https://github.com/rmuir/tree-sitter-ghactions"
},
"split_keywords": [
"incremental",
" parsing",
" tree-sitter",
" github",
" actions"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "93c6d01d1f7a8f73144ad76f05e46df649440465ab801abda6e420328501dee4",
"md5": "87a90ac3e4c280d34abde0026e06c411",
"sha256": "1adc325087cf464f767bdfc1673852600b8f6256e1634fdb73945479ae52c557"
},
"downloads": -1,
"filename": "tree_sitter_ghactions-0.2.1-cp310-abi3-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "87a90ac3e4c280d34abde0026e06c411",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 11823,
"upload_time": "2025-08-02T00:53:14",
"upload_time_iso_8601": "2025-08-02T00:53:14.589990Z",
"url": "https://files.pythonhosted.org/packages/93/c6/d01d1f7a8f73144ad76f05e46df649440465ab801abda6e420328501dee4/tree_sitter_ghactions-0.2.1-cp310-abi3-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "302e8c4cdf8ac9634cd53fd25ad6f238fc2c50b361d06ee097b75f631c8e68de",
"md5": "30e05b039ca021ef99972c5760bd9a1d",
"sha256": "7020ab493f2ff768fe7042609f4912b8ce4987295f4e5921984c2ff98c0a62cc"
},
"downloads": -1,
"filename": "tree_sitter_ghactions-0.2.1-cp310-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "30e05b039ca021ef99972c5760bd9a1d",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 12338,
"upload_time": "2025-08-02T00:53:15",
"upload_time_iso_8601": "2025-08-02T00:53:15.591532Z",
"url": "https://files.pythonhosted.org/packages/30/2e/8c4cdf8ac9634cd53fd25ad6f238fc2c50b361d06ee097b75f631c8e68de/tree_sitter_ghactions-0.2.1-cp310-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e32f83583af10b2be3b4ad2e2752d0e63603d371efcaef1ac948ef92abf05480",
"md5": "5523df3c7172abdd4868c95ba350d6f9",
"sha256": "5869ffc1ce6fdea3f2783940edb6f3b3d418d80234fac3f404593a9d6bf05c73"
},
"downloads": -1,
"filename": "tree_sitter_ghactions-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "5523df3c7172abdd4868c95ba350d6f9",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 23464,
"upload_time": "2025-08-02T00:53:16",
"upload_time_iso_8601": "2025-08-02T00:53:16.522516Z",
"url": "https://files.pythonhosted.org/packages/e3/2f/83583af10b2be3b4ad2e2752d0e63603d371efcaef1ac948ef92abf05480/tree_sitter_ghactions-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6be9c993a3edb8416c6b11f99d9454ce1f5dc061e08c088cf330f845e7fe4ead",
"md5": "6032ca163b25af14f69798b781846ec9",
"sha256": "0d46613b0121688791ab66321813ba0f82c7279d3964ff9bbd392dbdc2b6f205"
},
"downloads": -1,
"filename": "tree_sitter_ghactions-0.2.1-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "6032ca163b25af14f69798b781846ec9",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 23445,
"upload_time": "2025-08-02T00:53:17",
"upload_time_iso_8601": "2025-08-02T00:53:17.233270Z",
"url": "https://files.pythonhosted.org/packages/6b/e9/c993a3edb8416c6b11f99d9454ce1f5dc061e08c088cf330f845e7fe4ead/tree_sitter_ghactions-0.2.1-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9d775c2f09c32e85921ec76ea0a2e50233a37ea32cce7cf69a1670fca901419d",
"md5": "8394a92bcc31f7ec7c28195de52de4e9",
"sha256": "1199252691627283f830eb69b7db8361a4ed66c62be8d59c03f7b991e9866f50"
},
"downloads": -1,
"filename": "tree_sitter_ghactions-0.2.1-cp310-abi3-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "8394a92bcc31f7ec7c28195de52de4e9",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 22033,
"upload_time": "2025-08-02T00:53:18",
"upload_time_iso_8601": "2025-08-02T00:53:18.203325Z",
"url": "https://files.pythonhosted.org/packages/9d/77/5c2f09c32e85921ec76ea0a2e50233a37ea32cce7cf69a1670fca901419d/tree_sitter_ghactions-0.2.1-cp310-abi3-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "24ab02844b622faecfba0558635491999aa32f987b1f8e97bf94bbd89d4444d9",
"md5": "f113b578bb72d1ad4a7daadd6bf1579f",
"sha256": "1b6e32cf4aab75ae45c8121e076de2573ffa3b0a5f3eaaf30593c79c39d1f662"
},
"downloads": -1,
"filename": "tree_sitter_ghactions-0.2.1-cp310-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "f113b578bb72d1ad4a7daadd6bf1579f",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 14137,
"upload_time": "2025-08-02T00:53:18",
"upload_time_iso_8601": "2025-08-02T00:53:18.853385Z",
"url": "https://files.pythonhosted.org/packages/24/ab/02844b622faecfba0558635491999aa32f987b1f8e97bf94bbd89d4444d9/tree_sitter_ghactions-0.2.1-cp310-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "336c4eab2ebd5ec5ba9fe59b4a90ad8221ea68bc43fcbb0c29ff089f4e043158",
"md5": "a587896edad0b0eb7cd8e76cd74e7f07",
"sha256": "54a645a805115e1759806e76383423416a1b7a0fc6ad0f2e213dbbf5b055d58d"
},
"downloads": -1,
"filename": "tree_sitter_ghactions-0.2.1-cp310-abi3-win_arm64.whl",
"has_sig": false,
"md5_digest": "a587896edad0b0eb7cd8e76cd74e7f07",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 13082,
"upload_time": "2025-08-02T00:53:19",
"upload_time_iso_8601": "2025-08-02T00:53:19.482074Z",
"url": "https://files.pythonhosted.org/packages/33/6c/4eab2ebd5ec5ba9fe59b4a90ad8221ea68bc43fcbb0c29ff089f4e043158/tree_sitter_ghactions-0.2.1-cp310-abi3-win_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b1d522d5c0af87f8322849b29028f9fe9df7174f6ae0edeb8b3df17f03956920",
"md5": "5a60f17822660f5f4b0f79a80191b077",
"sha256": "126a6fbf293f354bf8861f6087ae23d72ef750a93ed4a74333871c3fcf65fe81"
},
"downloads": -1,
"filename": "tree_sitter_ghactions-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "5a60f17822660f5f4b0f79a80191b077",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 16621,
"upload_time": "2025-08-02T00:53:20",
"upload_time_iso_8601": "2025-08-02T00:53:20.444605Z",
"url": "https://files.pythonhosted.org/packages/b1/d5/22d5c0af87f8322849b29028f9fe9df7174f6ae0edeb8b3df17f03956920/tree_sitter_ghactions-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-02 00:53:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rmuir",
"github_project": "tree-sitter-ghactions",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "tree-sitter-ghactions"
}