Skip to content

Conversation

@rmuir
Copy link
Contributor

@rmuir rmuir commented Nov 24, 2025

Problem

gh_actions_ls requires repository metadata and access token for full functionality.

Solution

Use the gh CLI, if available, to populate the necessary metadata for the language server to provide completion and validation of "uses ... with" parameters, repository/organization variables and secrets.

Notes:

  • More info: https://github.com/actions/languageservices/tree/main/languageserver#providing-advanced-functionality
  • gh repo view is used, as opposed to alternatives such as gh api repos/{owner}/{repo} because it contains all the data needed and "just works".
  • You don't need to have configured a repo with gh, just have gh available and authed. For example, it still works if you havent gh repo set-default.
  • Tested with org repo, personal repo, and GHES with separate server. It is currently not possible to provide complete functionality for the GHES case with this language server...

Questions:

  • Is there a way to populate init_options like this without blocking the editor?

cc: @jugarpeupv who raised this on #4046

Problem

gh_actions_ls requires repository metadata and access token for full
functionality.

Solution

Use the `gh` CLI, if available, to populate the necessary metadata for
the language server to provide completion and validation of
"uses ... with" parameters, repository/organization variables and
secrets.
before_init = function(params, config)
if config.root_dir and vim.fn.executable('gh') == 1 then
params.initializationOptions = {
sessionToken = token(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably ad a :LspGhLogin or something like that, rather than calling this as soon as the config is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants