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.5.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.5-cp310-abi3-win_arm64.whl (13.6 kB view details)

Uploaded CPython 3.10+Windows ARM64

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

Uploaded CPython 3.10+Windows x86-64

tree_sitter_ghactions-0.2.5-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.5-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.5-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.5-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.5-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.5-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.5.tar.gz.

File metadata

  • Download URL: tree_sitter_ghactions-0.2.5.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.5.tar.gz
Algorithm Hash digest
SHA256 fc863ed9c24da0a9fb2713018999dc83b2dd94e9fc6bbff88a7749055a19d7ee
MD5 9c399b30fce0d207acc6d48cdbab4356
BLAKE2b-256 ac6f2280c3f990bc160c40c70ab60682c3929e1bc81e10b1ec851d00816f5486

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.5-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 2a104cdc393fff9fdbec5b15008a2a1011186b6d1a26a291a82ba9f7f9d12a72
MD5 3e8e1c43aceaabadd0a79dbae00f1079
BLAKE2b-256 3308817c7de17ef5326415b6d2746008911a4d7af37942d8ba2fb4db8f6deb25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b5e0b8b7108ca7a259858ddfbef90c4b22c8ef4c98192af0f05b408a5ea809e4
MD5 14cc83817c1f78cca02a7059be08cd47
BLAKE2b-256 e86ccaadca8330fb00adfcc1e7b56b476157fe784d9b8f7fb999d4f7bb187876

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.5-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ef78534f5e324aa1fe80418c6cd8d1a8050307d7ee466477301d34cb1821dcd6
MD5 08364360beb8e1cc7edc410102d917d8
BLAKE2b-256 51dc28a43b5733b1c37d3653e8d2418d8d5b3c5c28ffab650627fbe78037146d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.5-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 79cb375e58cbe61993850a1c9e1c1a2577840c9516045c4e434d35243912729f
MD5 0cdec670366bd572bcc908ba2f438e36
BLAKE2b-256 74524c06c3d0068d330ccea3d708c574f54672f07387e897b5c26c9eeac9d9ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.5-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cd298e79e61b8b73ef0c07e4e4e184d6cc043ea6f4b1c43276aedb42932b3ebe
MD5 560bc97b3c4dc469d9ef16404f16996e
BLAKE2b-256 dcec9e4e1f615347b6dcad062e89e4a08b7702470d8596fbccf0e0de7c028d89

See more details on using hashes here.

File details

Details for the file tree_sitter_ghactions-0.2.5-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.5-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 02dee381cb54239b2f81563515cd9d60591d3de44d5aa8c9d1b0ebf470a3abde
MD5 2c4b2f224d85a6a31e009638573ada78
BLAKE2b-256 57c918310f473341f4f3e87f8f5e623f383e9545b60f279317a1649c760ee5b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.5-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 18e33a920fada3c05a200c6fc3f64ea96704178b48b29ea95817c229924ad36e
MD5 21dfa64e36d485a96467df1e5677f740
BLAKE2b-256 690787f4640fc63b31b6cf15bc1a33ee5620a898c1628744e2766598a65187db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_ghactions-0.2.5-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 87458f08401ab16c52c27cb7d21ccfcce19a2d0dc68ae623e8756b1e8f6f219f
MD5 4c6ea1a27e6fac5c8c95d9360228419b
BLAKE2b-256 1d86ed81f344052c9ea0a8260766f8f444f331f219a427da561913f5ff15e4ba

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