The gh-actions plugin for Neovim allows developers to easily manage and dispatch their GitHub Actions workflow runs directly from within the editor.
- List workflows and their runs for the current repository
- Run/dispatch workflows with
workflow_dispatch
- Rerun a failed workflow
- Configurable keybindings
gw
(goto workflow) should open workflow file in buffer instead of browser- Allow to cycle between inputs on workflow_dispatch
Either have the cli yq installed or:
Using lazy.nvim
{
'topaxi/gh-actions.nvim',
keys = {
{ '<leader>gh', '<cmd>GhActions<cr>', desc = 'Open Github Actions' },
},
-- optional, you can also install and use `yq` instead.
build = 'make',
---@type GhActionsConfig
opts = {},
},
The plugin requires authentication with your GitHub account to access your workflows and runs. You can authenticate by running the gh auth login command
in your terminal and following the prompts.
Alternatively, define a GITHUB_TOKEN
variable in your environment.
:GhActions
or:GhActions toggle
toggles thegh-actions
split:GhActions open
opens thegh-actions
split:GhActions close
closes thegh-actions
split
The following keybindings are provided by the plugin:
q
- closes thegh-actions
the splitgw
- open the workflow file below the cursor on GitHubgr
- open the workflow run below the cursor on GitHubgj
- open the job of the workflow run below the cursor on GitHubd
- dispatch a new run for the workflow below the cursor on GitHub
The default options (as defined in lua/config.lua)
{
--- The browser executable path to open workflow runs/jobs in
---@type string|nil
browser = nil,
--- Interval to refresh in seconds
refresh_interval = 10,
--- How much workflow runs and jobs should be indented
indent = 2,
--- Allowed hosts to fetch data from, github.com is always allowed
--- @type string[]
allowed_hosts = {},
icons = {
workflow_dispatch = '⚡️',
conclusion = {
success = '✓',
failure = 'X',
startup_failure = 'X',
cancelled = '⊘',
skipped = '◌',
},
status = {
unknown = '?',
pending = '○',
queued = '○',
requested = '○',
waiting = '○',
in_progress = '●',
},
},
highlights = {
GhActionsRunIconSuccess = { link = 'LspDiagnosticsVirtualTextHint' },
GhActionsRunIconFailure = { link = 'LspDiagnosticsVirtualTextError' },
GhActionsRunIconStartup_failure = { link = 'LspDiagnosticsVirtualTextError' },
GhActionsRunIconPending = { link = 'LspDiagnosticsVirtualTextWarning' },
GhActionsRunIconRequested = { link = 'LspDiagnosticsVirtualTextWarning' },
GhActionsRunIconWaiting = { link = 'LspDiagnosticsVirtualTextWarning' },
GhActionsRunIconIn_progress = { link = 'LspDiagnosticsVirtualTextWarning' },
GhActionsRunIconCancelled = { link = 'Comment' },
GhActionsRunIconSkipped = { link = 'Comment' },
GhActionsRunCancelled = { link = 'Comment' },
GhActionsRunSkipped = { link = 'Comment' },
GhActionsJobCancelled = { link = 'Comment' },
GhActionsJobSkipped = { link = 'Comment' },
GhActionsStepCancelled = { link = 'Comment' },
GhActionsStepSkipped = { link = 'Comment' },
},
split = {
relative = 'editor',
position = 'right',
size = 60,
win_options = {
wrap = false,
number = false,
foldlevel = nil,
foldcolumn = '0',
cursorcolumn = false,
signcolumn = 'no',
},
},
}
require('lualine').setup({
sections = {
lualine_a = {
{ 'gh-actions' },
},
}
})
or with options:
require('lualine').setup({
sections = {
lualine_a = {
-- with default options
{ 'gh-actions', icon = '' },
},
}
})
- folke/lazy.nvim for the rendering approach