Skip to content

sbulav/validate-gitlab-ci.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

validate-gitlab-ci

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.

Prerequisites

  • Neovim >= 0.6
  • curl available
  • yq available
  • Plenary.nvim installed
  • Ensure you have GITLAB_API_TOKEN or GITLAB_TOKEN environment variable set.

Installation

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()

About

Validate Gitlab pipeline

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages