Neovim plugin that uses Gitlab CI lint API to validate your Gitlab CI Pipeline.
output.mp4
As /CI/lint
endpoint is deprecated in Gitlab
16.0
this plugin uses /projects/:id/ci/lint
to validate the pipeline.
Due to this, Gitlab token is required. Owner(Group) and project are detected automatically from the git repo.
- Neovim >= 0.6
- curl available
- yq available
- Plenary.nvim installed
- Ensure you have
GITLAB_API_TOKEN
orGITLAB_TOKEN
environment variable set.
return {
"sbulav/validate-gitlab-ci.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
}
use({'sbulav/ validate-gitlab-ci.nvim', requires = { "nvim-lua/plenary.nvim" } })
After installation, you can create autocommand group to run validate on save:
vim.api.nvim_create_augroup("ValidateGitlabCIfiles", { clear = true })
vim.api.nvim_create_autocmd("BufWritePre", {
callback = function()
require("validate-gitlab-ci.validate-gitlab-ci").validate()
end,
group = "ValidateGitlabCIfiles",
desc = "Validate Gitlab CI files on save",
pattern = ".gitlab-ci.yml",
})
Or run validation manually via command:
:lua require("validate-gitlab-ci.validate-gitlab-ci").validate()