Skip to main content

Parser for Github Actions expressions

Project description

tree-sitter-ghactions

Github Actions expressions grammar for tree-sitter

Features

  • Parses Github Action's expressions: ${{ ... }}
  • Plays well with bash injections in YAML documents
  • Passes parsing tests from actionlint

Neovim Installation (for use in your editor)

  1. Install nvim-treesitter

It is recommended to install at least yaml, bash, and comment parsers to support github actions files.

Optional parsers used for additional highlights: json, nim, nim_format_string

  1. Configure autocmd for a custom parser:
-- 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,
})
  1. Configure yaml injection in ~/.config/nvim/queries/yaml/injections.scm:
; extends

; github actions
([
  (string_scalar)
  (block_scalar)
  (double_quote_scalar)
  (single_quote_scalar)
  (ERROR)
] @injection.content
  (#lua-match? @injection.content "[$]{{")
  (#set! injection.language "ghactions"))
  1. 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

Screenshot of highlights

Syntax highlighting screenshot

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tree_sitter_ghactions-0.2.4.tar.gz (16.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tree_sitter_ghactions-0.2.4-cp310-abi3-win_arm64.whl (13.6 kB view details)

Uploaded CPython 3.10+Windows ARM64

tree_sitter_ghactions-0.2.4-cp310-abi3-win_amd64.whl (14.6 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_ghactions-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl (22.5 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

tree_sitter_ghactions-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl (23.8 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

tree_sitter_ghactions-0.2.4-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (24.6 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

tree_sitter_ghactions-0.2.4-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (22.5 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

tree_sitter_ghactions-0.2.4-cp310-abi3-macosx_11_0_arm64.whl (12.8 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_ghactions-0.2.4-cp310-abi3-macosx_10_9_x86_64.whl (12.5 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

Details for the file tree_sitter_ghactions-0.2.4.tar.gz.

File metadata

  • Download URL: tree_sitter_ghactions-0.2.4.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tree_sitter_ghactions-0.2.4.tar.gz
Algorithm Hash digest
SHA256 11bdcf028fbe6b2d290cb894b926a5ca5a445b35bfec5bd5cb5227c82ff917d7
MD5 0273e685762f071700e89ab3e4247a23
BLAKE2b-256 545cef67950bee2417ace4c17b37016f9214a2592011e113b2c90073536d02f7

See more details on using hashes here.

File details

Details for the file tree_sitter_ghactions-0.2.4-cp310-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.4-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 f621dc96246995501ca64508727831d19f78e4cdc9d4ad5d0a56e556521a738c
MD5 eeb8fa49ef4e35e244faa88135686750
BLAKE2b-256 b61e062186395bd26732843c66438ed18683fab1a89de410c6d412b62e79ca05

See more details on using hashes here.

File details

Details for the file tree_sitter_ghactions-0.2.4-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f1e12459c973353262773c229e427535deb61e804861410f1ca46ddabd97958f
MD5 595145555bd5a720d0edad6979100cf3
BLAKE2b-256 92dd24262022b69c34d0075582e489472da0fb5c7cee1bb9b2f21e9202a79df9

See more details on using hashes here.

File details

Details for the file tree_sitter_ghactions-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c6cd0830f191e9192055cf8b66323fc3d025bbb473914076c063c5adaafda9f4
MD5 8a63a60c2f5436123ec14a5897e50c82
BLAKE2b-256 420a5b21eda387b656e87c338905d85b1431dd27613057556b3aa173cbd96a8c

See more details on using hashes here.

File details

Details for the file tree_sitter_ghactions-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8826b77ae72865601569cb20f7302220374eac2d6c5ea8c39cf8772fdd70e47e
MD5 862c4ffd1309a724a3800565cd7da8af
BLAKE2b-256 525a53d5e6def58cb101a825cc073c6f8f09ea09a4229d79aadd37dd26bda436

See more details on using hashes here.

File details

Details for the file tree_sitter_ghactions-0.2.4-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.4-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 11542ba3ccf89f666b4d9a192e6fdbe97295e0742b80011759cd46fe206a2539
MD5 b9d01f6804aab5422d9ad0f6c61bc03a
BLAKE2b-256 b36ad2b621b3043a28324463f2b0d5186b5e8a9a75ff907ec7a92c936b94d851

See more details on using hashes here.

File details

Details for the file tree_sitter_ghactions-0.2.4-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.4-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 a21a2701ff5057318a1dc04e3c9b22376481e1f24bdca8de4b3384c98152864e
MD5 46845d53229fe6c4189f11591a2766eb
BLAKE2b-256 d8b0524ddcf03115b5f0845308117a9767985ace9685c23b23a59fa3ab690f26

See more details on using hashes here.

File details

Details for the file tree_sitter_ghactions-0.2.4-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.4-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 37b2ae540d153e37c7988db7708eb102baed20079f7c6248b161817e5756233f
MD5 c0f0433fba1854e82134e52ed2317150
BLAKE2b-256 61720f120ab4e3f42cad354dd425179f104e664b6af7cb3feec7c255739b48dc

See more details on using hashes here.

File details

Details for the file tree_sitter_ghactions-0.2.4-cp310-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.4-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 42adfdd75c4ca43ef396aec50517a50aaef5747ce08f4f1727ce82285f4b6d25
MD5 28fa57f3b0c916e7b9163ecaf29c64f3
BLAKE2b-256 64133bdcadef6cf611dbc31753ebe0c74b6dc498da5f7a78b89361be7cd2f1d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page