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.

  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)
] @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.2.tar.gz (16.6 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.2-cp310-abi3-win_arm64.whl (13.1 kB view details)

Uploaded CPython 3.10+Windows ARM64

tree_sitter_ghactions-0.2.2-cp310-abi3-win_amd64.whl (14.1 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_ghactions-0.2.2-cp310-abi3-musllinux_1_2_x86_64.whl (22.0 kB view details)

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

tree_sitter_ghactions-0.2.2-cp310-abi3-musllinux_1_2_aarch64.whl (23.3 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

tree_sitter_ghactions-0.2.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (24.1 kB view details)

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

tree_sitter_ghactions-0.2.2-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (22.0 kB view details)

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

tree_sitter_ghactions-0.2.2-cp310-abi3-macosx_11_0_arm64.whl (12.3 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_ghactions-0.2.2-cp310-abi3-macosx_10_9_x86_64.whl (11.9 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: tree_sitter_ghactions-0.2.2.tar.gz
  • Upload date:
  • Size: 16.6 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.2.tar.gz
Algorithm Hash digest
SHA256 c7847cf791d055ab85daabbb558b665a8cc5b464e5fe6b52284bd77c315e3d58
MD5 a27ba4f13e7fb298ad5febdba47e5428
BLAKE2b-256 00b8911fe386d49b831fe573072179d35f6806a116d78b664617179663161e81

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.2-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 1fa6fae16299182dde5709e9929020810b9b472f0fc0163f0f3ac3beed5f06ba
MD5 91965db3c7cbae9248eb2d82035ed46a
BLAKE2b-256 39f9ba447f8d67eded60852cd24a3a2849d457bdd9e772dc7a9b7bdf4063e5f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c3f71769a725cf5af32f49732fab1f0eb27cd817194b7c5a1cbd9f1cd1bd6ae8
MD5 7cbe4c618404789bc3af9966014ec3cf
BLAKE2b-256 e05343901eaad219841df1d6e53fcacf2fbee72b9488867b671bcdb63acaaa1d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.2-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9304b197e0d2e4e2e804eabc9b065f885717d24039d6f6e15677c3ee7e0998dc
MD5 61b6c9520f35ffa4bd17579ca3ed11c6
BLAKE2b-256 03bfe89702bc5907b3c0720bd83713e46e44196274d85018c0a4926bf3772ff2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.2-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 9445a72abddaec6d3ed43b65e7c528d49894c05440f455dc023b48bd9b4bce69
MD5 359eea76de16f00b706ee7fc669291da
BLAKE2b-256 000dce47e6467f82be816995deba2e9ee9f5f7eb16ad05d9525d14f46efc58de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 506a524821d9a7a19b162aa15e3b46943fa31574bd50c250302fc9a51bfcac4f
MD5 630e26b25243df877e9dcc18c7c20710
BLAKE2b-256 f3d0bfb1ca948f2bbbc6e025e1f043c3ee5a27968df0169aaaf337d22f272945

See more details on using hashes here.

File details

Details for the file tree_sitter_ghactions-0.2.2-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.2-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 ed6b470cce20595f60183a454a64ac9f357364029db4186b057f2beb3da27add
MD5 cf2c41d45ecdc2bd978d26492918aabe
BLAKE2b-256 3b5189f33317cfdc1a93c17a5fef98db4bb4fbd93f9b9dc4458ad389de367ac0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2e1ec16fae5285288e75845509351ba4eb7587178c7284a9426415cd96cfed8d
MD5 365306a47e78cf82c51662cb7e18aad5
BLAKE2b-256 559f2e6ce68548e91177157f46c1add96674fae680529e23b7e61df4d261884d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.2-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d894c02f43c5bc59ae0c6357de4d99c9b7b86c0579717c45df7e90568e9e6866
MD5 fe046c2a77a3a9908c52dfbc719dcc78
BLAKE2b-256 ae2f1b53b98774ddaf0f232b3518dc00b6928ae449bfbbd71aa08126ff200a87

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