languages: Add injections to highlight script blocks of actions/github-script as JavaScript (#43771)

Hello, this is my first time contributing here! The issue creation
button noted that "feature request"-esque items should go to
discussions, so with this PR, I'm closing that discussion and not an
issue. I hope that's ok :)

---

Closes https://github.com/zed-industries/zed/discussions/43769

Preview:

<img width="500" alt="image"
src="https://github.com/user-attachments/assets/00b8d475-d452-42e9-934b-ee5dbe48586e"
/><p/>

Release Notes:

- Added JavaScript highlighting via YAML `injections.scm` for script
blocks of `actions/github-script`
This commit is contained in:
Novus Nota
2025-12-02 17:30:09 +00:00
committed by GitHub
parent 3d58738548
commit 7c95834b7b
+22
View File
@@ -1,3 +1,25 @@
((comment) @injection.content
(#set! injection.language "comment")
)
; GitHub actions: JavaScript for workflow scripting (inline and block)
(block_mapping
(block_mapping_pair
key: (flow_node) @_uses (#eq? @_uses "uses")
value: (flow_node) @_actions_ghs (#match? @_actions_ghs "^actions/github-script"))
(block_mapping_pair
key: (flow_node) @_with (#eq? @_with "with")
value: (block_node
(block_mapping
(block_mapping_pair
key: (flow_node) @_run (#eq? @_run "script")
value: [
(flow_node (plain_scalar (string_scalar) @injection.content))
(block_node (block_scalar) @injection.content)
]
(#set! injection.language "javascript")
)
)
)
)
)