Module: Gitlab::Client::Lint

Included in:
Gitlab::Client
Defined in:
lib/gitlab/client/lint.rb

Overview

Defines methods related to lint/validations.

Instance Method Summary collapse

Instance Method Details

#validate_gitlab_ci_yml(content) ⇒ Gitlab::ObjectifiedHash

Checks if your .gitlab-ci.yml file is valid.

Examples:

Gitlab.validate_gitlab_ci_yml("{ \"image\": \"ruby:2.6\", \"services\": [\"postgres\"], \"before_script\": [\"bundle install\", \"bundle exec rake db:create\"], \"variables\": {\"DB_NAME\": \"postgres\"}, \"types\": [\"test\", \"deploy\", \"notify\"], \"rspec\": { \"script\": \"rake spec\", \"tags\": [\"ruby\", \"postgres\"], \"only\": [\"branches\"]}}")

Parameters:

  • content (String)

    the .gitlab-ci.yaml content.

Returns:



14
15
16
17
# File 'lib/gitlab/client/lint.rb', line 14

def validate_gitlab_ci_yml(content)
  body = { content: content }
  post('/lint', body: body)
end