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

  2. 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)
] @injection.content
  (#lua-match? @injection.content "[$]{{.*}}")
  (#set! injection.language "ghactions"))
  1. 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

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.0.tar.gz (15.9 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.0-cp310-abi3-win_arm64.whl (12.1 kB view details)

Uploaded CPython 3.10+Windows ARM64

tree_sitter_ghactions-0.2.0-cp310-abi3-win_amd64.whl (13.2 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_ghactions-0.2.0-cp310-abi3-musllinux_1_2_x86_64.whl (20.9 kB view details)

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

tree_sitter_ghactions-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (22.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

tree_sitter_ghactions-0.2.0-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (22.3 kB view details)

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

tree_sitter_ghactions-0.2.0-cp310-abi3-macosx_11_0_arm64.whl (11.2 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_ghactions-0.2.0-cp310-abi3-macosx_10_9_x86_64.whl (10.7 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for tree_sitter_ghactions-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e857c9e730e5428a191514223c75b46a23fdf06f7e90b751f5e67566f17bce07
MD5 53b6aa3cef692f07c332d092d486a083
BLAKE2b-256 ce1a3134a3c666948ad74592b0038adf518ab879bcb70a04e96c39ec0e2409f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.0-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 48b38bae124b7fe9ab917b98a8c153884ae767ef65bccea4e13289b8de9f4e36
MD5 c90ab81aefdf5d3c6ca5a669bfbe67eb
BLAKE2b-256 579d243b53f06bb0866abd04c8c85b41470f8ce35c3611c369f43ea7755f056c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9c70a1e92a7827a2f7e622f374406fc331921d85cfea50d4471581d8456546db
MD5 25563ec199dfd515418c68346bfdf3d7
BLAKE2b-256 9baab310ac49c2d768045ae316def06c183645d9c346abc8a9142c69f3cce9c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.0-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4719f85aa14cf6eb4389c1709cf1fb01678efb1286c6bdc5daf5025ce7324667
MD5 b3ad03a5d432b42936f4c0381acc2b01
BLAKE2b-256 5860e9a123b3833f20631c79bac79dfc341dca2e7c4ead0abb31887b1d290f1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 822502b1807afaa2cae6e87b0869ef9d4f2cea9f1584d0bbd811d9e0fbca767d
MD5 dc5fb3a15cbd06097109570fec802c76
BLAKE2b-256 841cfae07406565c5c2318f711fb2cff8de31c1e6f9a1746e1f7d95b03337497

See more details on using hashes here.

File details

Details for the file tree_sitter_ghactions-0.2.0-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.0-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fe51127c7010795721f1d8613980d5c65e9f09c20c86a2c5901e96c9b9da666c
MD5 b284d6f281d6b078cf735fca5a9e127a
BLAKE2b-256 d04636d2e01ea351995eb001a4ad391174b7ebc0b43495d2066f470f9a4e0c19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9531e029e6fd310c4f666ce761f2b5d256bde01dcf9423ccf22825da138c7ec5
MD5 1ed3a174e588144f75919ea61bff4520
BLAKE2b-256 f5806a667bee38e184cc81180a6f6a58fc3d8038cad28512df310f6aaba06e2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.0-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 79b6e39516a4e90b54244aac722f29113d1d1b17766764594e4168e2475f1782
MD5 c7ad6e26dc0d6bf950d67419d851918e
BLAKE2b-256 7a3d1c3f6cbd53cdea1e5617e26e7d914a8319a47f1f7911cbfcbaf7966a6fb2

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