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, json, 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)
  (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.3.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.3-cp310-abi3-win_arm64.whl (13.5 kB view details)

Uploaded CPython 3.10+Windows ARM64

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

Uploaded CPython 3.10+Windows x86-64

tree_sitter_ghactions-0.2.3-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.3-cp310-abi3-musllinux_1_2_aarch64.whl (23.7 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

tree_sitter_ghactions-0.2.3-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.3-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.3-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.3-cp310-abi3-macosx_10_9_x86_64.whl (12.4 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: tree_sitter_ghactions-0.2.3.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.3.tar.gz
Algorithm Hash digest
SHA256 6f3b3c17201f99924644569e82ae47c1b8d6640c46ff6ecbb4b3e31c806866d2
MD5 053387a1774771af98dac8bd45f5b997
BLAKE2b-256 5a973996f057a63b5657df51eb3f83a52ff442655b8451074392c1166e7aafc0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.3-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 07fc7233bbe1fa0684416be0fa296d65f84088316e307dc6c3009da2ddde4c15
MD5 d49f1544e87eee213463c8c33bc5dc4e
BLAKE2b-256 aa7c37607269cc6c2807d6d04b8c3ce4795a14c62533e65e592914875b455fb8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.3-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ae7474f4f70707cc3652b7a45232487659961ab5d130d479620351347baafe73
MD5 cbde608d079261a9c6f129ee2c79a099
BLAKE2b-256 bc6d3813d1510ce09f661337304693b236638a29cdae0c7c7dad88b462635e05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.3-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3f1dc1e40c67da3d7ea6fc7b5f150ec16e31d46b5568da1b529fa6837742bde6
MD5 f569ba4fe926138151e1f12696268956
BLAKE2b-256 fa69f2fa445f73069029e9d5ff806e2b1da958ece95ed2b8fef4d262622840de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.3-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 ceade876d08ba1ba47f058790256fd20e4fdc6f043645d64bf84959249589aff
MD5 5172675a3b3fb29b03d9351c0c83bf23
BLAKE2b-256 3c69dab0ae30f87c5de2dfcea32dfbf6f49c8afcd7455030a7896a9df2b6a96a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.3-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2180d8222f95d95af5b4b677c005cdd33df9a6bbed72342868977c82a5cd97fe
MD5 fdd643145fac8e158d03057f1e783c9c
BLAKE2b-256 aeb7ae5820da94ec39554db73973b00b6992bc0f19165d03dfd259b0ed0dbbb8

See more details on using hashes here.

File details

Details for the file tree_sitter_ghactions-0.2.3-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.3-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 afbdab7f1c04a2a4752d4ce80412e88f72709a3fd72675aed8595ab36a7f1e21
MD5 e8d16a72e9dc5e2b450a69d3b02cdcc6
BLAKE2b-256 6ad0daa6bce46425af1e1195835052befc46579cbaa541bd4dfa6d89ceebaefa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.3-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b037b937f720b8e3323ec2f9a397affc5df7ed9fa0b273c74a257fe5ff801976
MD5 4103a45a03c56553774bcd999b25eba1
BLAKE2b-256 75d48793a4c3fcfa67a8a973e8aada155a1f85b5eb067f81efbe89b38d1bd960

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.3-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 08b05de9a56ec8292074d98461ed136e94fd34f211e38430c42db0e33839d027
MD5 e4c3214cdddfb5b6211bd9ee88a3c1d2
BLAKE2b-256 0359532d9be9ea63c0e20aa3e2cc390d9fb2da05ebc99a95d0558ec632e2b7c9

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