# tree-sitter-gh-actions-expressions
[![CI][ci]](https://github.com/Hdoc1509/tree-sitter-gh-actions-expressions/actions/workflows/ci.yml)
[![discord][discord]](https://discord.gg/w7nTvsVJhm)
[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
[![crates][crates]](https://crates.io/crates/tree-sitter-gh-actions-expressions)
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-gh-actions-expressions)
[![pypi][pypi]](https://pypi.org/project/tree-sitter-gh-actions-expressions)
[Tree-sitter](https://github.com/tree-sitter/tree-sitter) grammar for
[Github Actions expressions][gh-actions-expressions-docs]
## Parser requirements
- [`gitignore`](https://github.com/shunsambongi/tree-sitter-gitignore)
(optional): for `hashFiles()` function
- [`json`](https://github.com/tree-sitter/tree-sitter-json) (optional): for
`fromJSON()` function
- [`yaml`](https://github.com/tree-sitter/tree-sitter-yaml): injection to its
`block_mapping_pair` node
## Usage in Editors
### Neovim
#### Requirements
- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
- [Node.js](https://nodejs.org/en/download) (if ABI not compatible)
- [tree-sitter cli](https://github.com/tree-sitter/tree-sitter/tree/master/crates/cli)
(if ABI not compatible)
#### Installation
1. Add the following to your `nvim-treesitter` configuration:
```lua
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
-- NOTE: add the parser to `parser_config` before calling `setup()`
parser_config.gh_actions_expressions = {
install_info = {
url = 'https://github.com/Hdoc1509/tree-sitter-gh-actions-expressions',
files = { "src/parser.c" },
branch = 'release',
-- if ABI version from neovim doesn't match the one from this grammar
-- requires Node.js and tree-sitter cli to be installed
requires_generate_from_grammar = true,
},
}
require('nvim-treesitter.configs').setup({
ensure_installed = {
--- other parsers
'gh_actions_expressions',
},
-- other options
})
```
2. Copy the queries from [`queries`](./queries) directory to
`queries/gh_actions_expression` directory in your `neovim` configuration
directory:
| With | Path |
| --------------------- | ----------------------- |
| Unix | `~/.config/nvim` |
| Windows | `~/AppData/Local/nvim` |
| `XDG_CONFIG_HOME` set | `$XDG_CONFIG_HOME/nvim` |
### Helix
WIP
### Emacs
WIP
### In General
You can get the built files from the [`release` branch][release-branch]. If you
have specific instructions for your editor, PR's are welcome.
## Implementations
WIP
## References
- [Github Actions expressions documentation][gh-actions-expressions-docs]
- `if` conditional:
- [run.steps\[\*\].if][gh-run-steps-if]
- [jobs.\<job_id>.if][gh-jobs-jobid-if]
- [Gihub Actions Context documentation][gh-actions-context-docs]
## Thanks
Thanks to [@disrupted](https://github.com/disrupted) for creating
[tree-sitter-github-actions grammar](https://github.com/disrupted/tree-sitter-github-actions),
which is the base I used to create this grammar.
[ci]: https://github.com/Hdoc1509/tree-sitter-gh-actions-expressions/actions/workflows/ci.yml/badge.svg
[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord
[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
[crates]: https://img.shields.io/crates/v/tree-sitter-gh-actions-expressions?logo=rust
[npm]: https://img.shields.io/npm/v/tree-sitter-gh-actions-expressions?logo=npm
[pypi]: https://img.shields.io/pypi/v/tree-sitter-gh-actions-expressions?logo=pypi&logoColor=ffd242
[gh-actions-expressions-docs]: https://docs.github.com/en/actions/reference/evaluate-expressions-in-workflows-and-actions
[gh-run-steps-if]: https://docs.github.com/en/actions/reference/workflows-and-actions/metadata-syntax#runsstepsif
[gh-jobs-jobid-if]: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idif
[gh-actions-context-docs]: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts
[release-branch]: https://github.com/Hdoc1509/tree-sitter-gh-actions-expressions/tree/release
Raw data
{
"_id": null,
"home_page": null,
"name": "tree-sitter-gh-actions-expressions",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "incremental, parsing, tree-sitter, gh-actions-expressions",
"author": null,
"author_email": "H\u00e9ctor Ochoa <hector.ochoa.dev@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c6/85/6f4ac6ec3fd92da2b5e9435c8993d847ca4998ed307627ee8114ede9827c/tree_sitter_gh_actions_expressions-0.2.0.tar.gz",
"platform": null,
"description": "# tree-sitter-gh-actions-expressions\n\n[![CI][ci]](https://github.com/Hdoc1509/tree-sitter-gh-actions-expressions/actions/workflows/ci.yml)\n[![discord][discord]](https://discord.gg/w7nTvsVJhm)\n[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)\n[![crates][crates]](https://crates.io/crates/tree-sitter-gh-actions-expressions)\n[![npm][npm]](https://www.npmjs.com/package/tree-sitter-gh-actions-expressions)\n[![pypi][pypi]](https://pypi.org/project/tree-sitter-gh-actions-expressions)\n\n[Tree-sitter](https://github.com/tree-sitter/tree-sitter) grammar for\n[Github Actions expressions][gh-actions-expressions-docs]\n\n## Parser requirements\n\n- [`gitignore`](https://github.com/shunsambongi/tree-sitter-gitignore)\n (optional): for `hashFiles()` function\n- [`json`](https://github.com/tree-sitter/tree-sitter-json) (optional): for\n `fromJSON()` function\n- [`yaml`](https://github.com/tree-sitter/tree-sitter-yaml): injection to its\n `block_mapping_pair` node\n\n## Usage in Editors\n\n### Neovim\n\n#### Requirements\n\n- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)\n- [Node.js](https://nodejs.org/en/download) (if ABI not compatible)\n- [tree-sitter cli](https://github.com/tree-sitter/tree-sitter/tree/master/crates/cli)\n (if ABI not compatible)\n\n#### Installation\n\n1. Add the following to your `nvim-treesitter` configuration:\n\n ```lua\n local parser_config = require(\"nvim-treesitter.parsers\").get_parser_configs()\n\n -- NOTE: add the parser to `parser_config` before calling `setup()`\n parser_config.gh_actions_expressions = {\n install_info = {\n url = 'https://github.com/Hdoc1509/tree-sitter-gh-actions-expressions',\n files = { \"src/parser.c\" },\n branch = 'release',\n -- if ABI version from neovim doesn't match the one from this grammar\n -- requires Node.js and tree-sitter cli to be installed\n requires_generate_from_grammar = true,\n },\n }\n\n require('nvim-treesitter.configs').setup({\n ensure_installed = {\n --- other parsers\n 'gh_actions_expressions',\n },\n -- other options\n })\n ```\n\n2. Copy the queries from [`queries`](./queries) directory to\n `queries/gh_actions_expression` directory in your `neovim` configuration\n directory:\n\n | With | Path |\n | --------------------- | ----------------------- |\n | Unix | `~/.config/nvim` |\n | Windows | `~/AppData/Local/nvim` |\n | `XDG_CONFIG_HOME` set | `$XDG_CONFIG_HOME/nvim` |\n\n### Helix\n\nWIP\n\n### Emacs\n\nWIP\n\n### In General\n\nYou can get the built files from the [`release` branch][release-branch]. If you\nhave specific instructions for your editor, PR's are welcome.\n\n## Implementations\n\nWIP\n\n## References\n\n- [Github Actions expressions documentation][gh-actions-expressions-docs]\n- `if` conditional:\n - [run.steps\\[\\*\\].if][gh-run-steps-if]\n - [jobs.\\<job_id>.if][gh-jobs-jobid-if]\n- [Gihub Actions Context documentation][gh-actions-context-docs]\n\n## Thanks\n\nThanks to [@disrupted](https://github.com/disrupted) for creating\n[tree-sitter-github-actions grammar](https://github.com/disrupted/tree-sitter-github-actions),\nwhich is the base I used to create this grammar.\n\n[ci]: https://github.com/Hdoc1509/tree-sitter-gh-actions-expressions/actions/workflows/ci.yml/badge.svg\n[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord\n[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix\n[crates]: https://img.shields.io/crates/v/tree-sitter-gh-actions-expressions?logo=rust\n[npm]: https://img.shields.io/npm/v/tree-sitter-gh-actions-expressions?logo=npm\n[pypi]: https://img.shields.io/pypi/v/tree-sitter-gh-actions-expressions?logo=pypi&logoColor=ffd242\n[gh-actions-expressions-docs]: https://docs.github.com/en/actions/reference/evaluate-expressions-in-workflows-and-actions\n[gh-run-steps-if]: https://docs.github.com/en/actions/reference/workflows-and-actions/metadata-syntax#runsstepsif\n[gh-jobs-jobid-if]: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idif\n[gh-actions-context-docs]: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts\n[release-branch]: https://github.com/Hdoc1509/tree-sitter-gh-actions-expressions/tree/release\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Github Actions expressions grammar for tree-sitter",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/hdoc1509/tree-sitter-gh-actions-expressions"
},
"split_keywords": [
"incremental",
" parsing",
" tree-sitter",
" gh-actions-expressions"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "32d5bd1849a6609f1beedd66c86b2471a51b70b835264e02cb7dfd5bb09965a4",
"md5": "b1b403232ebc776e9faaa69c2e2d8dea",
"sha256": "aa78061bf6a5ab914330b92559b9ba97314cc440abe97003d4cc4d9b1cd66355"
},
"downloads": -1,
"filename": "tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "b1b403232ebc776e9faaa69c2e2d8dea",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 14121,
"upload_time": "2025-09-18T16:15:36",
"upload_time_iso_8601": "2025-09-18T16:15:36.399703Z",
"url": "https://files.pythonhosted.org/packages/32/d5/bd1849a6609f1beedd66c86b2471a51b70b835264e02cb7dfd5bb09965a4/tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "38dc2476739fc449c7d8be97fcfdc80f0a7add046e6c803821bdac26802523de",
"md5": "194f9068ad7ab460ae97c674f4151708",
"sha256": "331ede724477f65f278e05bcb84612149de4b06103ab3f579f8d77dfdcf4702a"
},
"downloads": -1,
"filename": "tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "194f9068ad7ab460ae97c674f4151708",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 14454,
"upload_time": "2025-09-18T16:15:37",
"upload_time_iso_8601": "2025-09-18T16:15:37.380579Z",
"url": "https://files.pythonhosted.org/packages/38/dc/2476739fc449c7d8be97fcfdc80f0a7add046e6c803821bdac26802523de/tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b81854362d7973c07856aa94fd14647bd10145a02c1c6bdaec8bfe58b27e4db4",
"md5": "47bf094c5381ad926b696745cd91241b",
"sha256": "3910eaeacc2cf38f0241c80e1853ae3acef51887a78717502db89fdef249fb05"
},
"downloads": -1,
"filename": "tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl",
"has_sig": false,
"md5_digest": "47bf094c5381ad926b696745cd91241b",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 24617,
"upload_time": "2025-09-18T16:15:38",
"upload_time_iso_8601": "2025-09-18T16:15:38.325991Z",
"url": "https://files.pythonhosted.org/packages/b8/18/54362d7973c07856aa94fd14647bd10145a02c1c6bdaec8bfe58b27e4db4/tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "feb21f08d3a293f866ab8af0233c8f1bbc42b15b51aff7daf4195209a185fbe3",
"md5": "1bb1bbc61c09d1382cf7e0a89a1f090c",
"sha256": "ded250b568b7ba3d3711959b24c53ba0b8654163244d3fb301a3d73f096f2f8c"
},
"downloads": -1,
"filename": "tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl",
"has_sig": false,
"md5_digest": "1bb1bbc61c09d1382cf7e0a89a1f090c",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 25851,
"upload_time": "2025-09-18T16:15:39",
"upload_time_iso_8601": "2025-09-18T16:15:39.379939Z",
"url": "https://files.pythonhosted.org/packages/fe/b2/1f08d3a293f866ab8af0233c8f1bbc42b15b51aff7daf4195209a185fbe3/tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "fb03fada4723d1688a69e95a4839b236e44520ae7a0f135f6506a7df9fa119de",
"md5": "8f6d133265bb8a5527a3970db67c2e2e",
"sha256": "f1d5db414ed66aa8b72c16978e399f86ef541801aea93be89d939a85b215bc8e"
},
"downloads": -1,
"filename": "tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-musllinux_1_2_aarch64.whl",
"has_sig": false,
"md5_digest": "8f6d133265bb8a5527a3970db67c2e2e",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 25029,
"upload_time": "2025-09-18T16:15:40",
"upload_time_iso_8601": "2025-09-18T16:15:40.068746Z",
"url": "https://files.pythonhosted.org/packages/fb/03/fada4723d1688a69e95a4839b236e44520ae7a0f135f6506a7df9fa119de/tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-musllinux_1_2_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c09e542240bfe0a932727e29bd219f3fd2389a11aec58597800e5e66bb9b9675",
"md5": "d5ba5c3e485d13dace2d1503282386eb",
"sha256": "f466bdc8e9ff0e4695445d52c751c137c5f03cdcce7b2c9aba6fda6c94f8901a"
},
"downloads": -1,
"filename": "tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "d5ba5c3e485d13dace2d1503282386eb",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 24437,
"upload_time": "2025-09-18T16:15:41",
"upload_time_iso_8601": "2025-09-18T16:15:41.035780Z",
"url": "https://files.pythonhosted.org/packages/c0/9e/542240bfe0a932727e29bd219f3fd2389a11aec58597800e5e66bb9b9675/tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0c63c1032cb0822f9a55fcaf0e85ea8324084b7e3eb9e6fed3fa37c21823d317",
"md5": "3128ac1d4b856465a62a8eac109a1f7c",
"sha256": "9e32b0893a38d508f00357111c5aeb158a1d6629ffe221dce7f316d945a159b0"
},
"downloads": -1,
"filename": "tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "3128ac1d4b856465a62a8eac109a1f7c",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 16249,
"upload_time": "2025-09-18T16:15:41",
"upload_time_iso_8601": "2025-09-18T16:15:41.735546Z",
"url": "https://files.pythonhosted.org/packages/0c/63/c1032cb0822f9a55fcaf0e85ea8324084b7e3eb9e6fed3fa37c21823d317/tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "fbd92612a22d111b8632e185e14bff57d81a38c17b7509f10f954393115af6e6",
"md5": "4b446afaa10605cfccbfaa7d7be91d8f",
"sha256": "157518559402938e29c11ebd9ee0be8d9e1b0ca1ecd93cda0a563e0590ce3df5"
},
"downloads": -1,
"filename": "tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-win_arm64.whl",
"has_sig": false,
"md5_digest": "4b446afaa10605cfccbfaa7d7be91d8f",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 15213,
"upload_time": "2025-09-18T16:15:42",
"upload_time_iso_8601": "2025-09-18T16:15:42.767728Z",
"url": "https://files.pythonhosted.org/packages/fb/d9/2612a22d111b8632e185e14bff57d81a38c17b7509f10f954393115af6e6/tree_sitter_gh_actions_expressions-0.2.0-cp310-abi3-win_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c6856f4ac6ec3fd92da2b5e9435c8993d847ca4998ed307627ee8114ede9827c",
"md5": "7c3f2a1945776e8bdd2fc72990284a53",
"sha256": "ec1f8e244c4db8fdfed170c9960f1514d1814870f8deed89117d4d535618152f"
},
"downloads": -1,
"filename": "tree_sitter_gh_actions_expressions-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "7c3f2a1945776e8bdd2fc72990284a53",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 19398,
"upload_time": "2025-09-18T16:15:43",
"upload_time_iso_8601": "2025-09-18T16:15:43.465329Z",
"url": "https://files.pythonhosted.org/packages/c6/85/6f4ac6ec3fd92da2b5e9435c8993d847ca4998ed307627ee8114ede9827c/tree_sitter_gh_actions_expressions-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-18 16:15:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hdoc1509",
"github_project": "tree-sitter-gh-actions-expressions",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "tree-sitter-gh-actions-expressions"
}