tree-sitter-ghactions


Nametree-sitter-ghactions JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
SummaryParser for Github Actions expressions
upload_time2025-07-26 21:02:59
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT
keywords incremental parsing tree-sitter github actions
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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)

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` 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

![Syntax highlighting screenshot](https://github.com/user-attachments/assets/0c1f34bb-6f02-4175-9495-97e6fa51334a)

            

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/b8/54/028b345710d11d184e5be2991ff8bde83c3d1950f515af10895b8c84c185/tree_sitter_ghactions-0.1.2.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\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` 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![Syntax highlighting screenshot](https://github.com/user-attachments/assets/0c1f34bb-6f02-4175-9495-97e6fa51334a)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Parser for Github Actions expressions",
    "version": "0.1.2",
    "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": "603e81a24c37870491319e22adf54c5f30796f8b5feef79d65d8ffb78782a4ad",
                "md5": "0467b46ae54af99ab154cc5a469f213f",
                "sha256": "936cc5ee69f1d090b834ad70c8fb5df6256b04f7b30b5965760d39e0046da370"
            },
            "downloads": -1,
            "filename": "tree_sitter_ghactions-0.1.2-cp310-abi3-macosx_10_9_x86_64.whl",
            "has_sig": false,
            "md5_digest": "0467b46ae54af99ab154cc5a469f213f",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 10699,
            "upload_time": "2025-07-26T21:02:52",
            "upload_time_iso_8601": "2025-07-26T21:02:52.697712Z",
            "url": "https://files.pythonhosted.org/packages/60/3e/81a24c37870491319e22adf54c5f30796f8b5feef79d65d8ffb78782a4ad/tree_sitter_ghactions-0.1.2-cp310-abi3-macosx_10_9_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9e1df710c592ef0dc009ffb915d312fa515dba2b3119729491c33f10aaca676b",
                "md5": "87f239e6fe680295a44a000d1e4c056b",
                "sha256": "bde60849249787eec2cd6cc7f9577d42907782f730b8d5c67030390f842a0282"
            },
            "downloads": -1,
            "filename": "tree_sitter_ghactions-0.1.2-cp310-abi3-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "87f239e6fe680295a44a000d1e4c056b",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 11224,
            "upload_time": "2025-07-26T21:02:53",
            "upload_time_iso_8601": "2025-07-26T21:02:53.914874Z",
            "url": "https://files.pythonhosted.org/packages/9e/1d/f710c592ef0dc009ffb915d312fa515dba2b3119729491c33f10aaca676b/tree_sitter_ghactions-0.1.2-cp310-abi3-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "52ff0e1a759821c75ed7a691b460a4685673269c9b1b104fa02f76105068d214",
                "md5": "4233dcbdc94637f8f090f613666b51ca",
                "sha256": "016921048b42aa72c61aef1c80bce58954bf23b1cd9daef914fa1d78fb68902a"
            },
            "downloads": -1,
            "filename": "tree_sitter_ghactions-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "has_sig": false,
            "md5_digest": "4233dcbdc94637f8f090f613666b51ca",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 22486,
            "upload_time": "2025-07-26T21:02:54",
            "upload_time_iso_8601": "2025-07-26T21:02:54.941542Z",
            "url": "https://files.pythonhosted.org/packages/52/ff/0e1a759821c75ed7a691b460a4685673269c9b1b104fa02f76105068d214/tree_sitter_ghactions-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a5be86732b95661d7f659eadbd91e2707c8214bb3819ce191f5288788777f65b",
                "md5": "b9dd531730ea9479377c3f18070099ba",
                "sha256": "f6f8c80c366308d3ba0e78f6a7aa860e779e718082549a60d2aefaca035fa1b1"
            },
            "downloads": -1,
            "filename": "tree_sitter_ghactions-0.1.2-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "b9dd531730ea9479377c3f18070099ba",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 22453,
            "upload_time": "2025-07-26T21:02:55",
            "upload_time_iso_8601": "2025-07-26T21:02:55.956137Z",
            "url": "https://files.pythonhosted.org/packages/a5/be/86732b95661d7f659eadbd91e2707c8214bb3819ce191f5288788777f65b/tree_sitter_ghactions-0.1.2-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": "612fe47e34f32bf41fbd111874fd700d2f783ffe4613b3c49c7d3eacf0719cf2",
                "md5": "46f3a3de7e9b0f5b71896188e03b88b3",
                "sha256": "5e9f310a174749bc329212b6b9b1feef68ef6f88c09b1e42a3cc895822eeaa3d"
            },
            "downloads": -1,
            "filename": "tree_sitter_ghactions-0.1.2-cp310-abi3-musllinux_1_2_x86_64.whl",
            "has_sig": false,
            "md5_digest": "46f3a3de7e9b0f5b71896188e03b88b3",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 21026,
            "upload_time": "2025-07-26T21:02:56",
            "upload_time_iso_8601": "2025-07-26T21:02:56.942445Z",
            "url": "https://files.pythonhosted.org/packages/61/2f/e47e34f32bf41fbd111874fd700d2f783ffe4613b3c49c7d3eacf0719cf2/tree_sitter_ghactions-0.1.2-cp310-abi3-musllinux_1_2_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9595a3bca2375091988df331816661ce9390c7efaf4cd07a5c3ce6389e8f3593",
                "md5": "06634dd150373fbfff453fc1d9daff12",
                "sha256": "2c8bf8c9b09559dbf3c3046c96ac3f859a6b7cc53e5d95e74a10d089254f92e7"
            },
            "downloads": -1,
            "filename": "tree_sitter_ghactions-0.1.2-cp310-abi3-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "06634dd150373fbfff453fc1d9daff12",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 13177,
            "upload_time": "2025-07-26T21:02:57",
            "upload_time_iso_8601": "2025-07-26T21:02:57.597921Z",
            "url": "https://files.pythonhosted.org/packages/95/95/a3bca2375091988df331816661ce9390c7efaf4cd07a5c3ce6389e8f3593/tree_sitter_ghactions-0.1.2-cp310-abi3-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "598e0d8d04a5d63672eac70f4986a136e084ca4cf434a0ae75951ee4d8679420",
                "md5": "a9bdf058f9c746ad3cd595b7204eb9e3",
                "sha256": "83d263d28593464958e7124a542682c4652053cd9aa15437c1e555f72c6af301"
            },
            "downloads": -1,
            "filename": "tree_sitter_ghactions-0.1.2-cp310-abi3-win_arm64.whl",
            "has_sig": false,
            "md5_digest": "a9bdf058f9c746ad3cd595b7204eb9e3",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 12167,
            "upload_time": "2025-07-26T21:02:58",
            "upload_time_iso_8601": "2025-07-26T21:02:58.582420Z",
            "url": "https://files.pythonhosted.org/packages/59/8e/0d8d04a5d63672eac70f4986a136e084ca4cf434a0ae75951ee4d8679420/tree_sitter_ghactions-0.1.2-cp310-abi3-win_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b854028b345710d11d184e5be2991ff8bde83c3d1950f515af10895b8c84c185",
                "md5": "71867f140746b7484cabe817a811f728",
                "sha256": "e274f48a2d5c6913dc33d8e725a7f491f922190863cdf04450bed760356013de"
            },
            "downloads": -1,
            "filename": "tree_sitter_ghactions-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "71867f140746b7484cabe817a811f728",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 15971,
            "upload_time": "2025-07-26T21:02:59",
            "upload_time_iso_8601": "2025-07-26T21:02:59.511339Z",
            "url": "https://files.pythonhosted.org/packages/b8/54/028b345710d11d184e5be2991ff8bde83c3d1950f515af10895b8c84c185/tree_sitter_ghactions-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-26 21:02:59",
    "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"
}
        
Elapsed time: 1.88087s