Package Exports
- tree-sitter-ghactions
- tree-sitter-ghactions/bindings/node/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tree-sitter-ghactions) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
tree-sitter-ghactions
Github Actions expressions grammar for tree-sitter
Features
- Parses Github Action's expressions:
${{ ... }} - Plays well with
bashinjections in YAML documents - Passes parsing tests from actionlint
Neovim Installation (for use in your editor)
- Install nvim-treesitter
It is recommended to install at least yaml, bash, and comment parsers to support github actions files.
- 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,
})- 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"))- Run
:TSUpdateand:TSInstall ghactionsfrom 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