Class: WayOfWorking::CodeLinting::Hdi::GithubAuditRule

Inherits:
Audit::Github::Rules::Base
  • Object
show all
Defined in:
lib/way_of_working/code_linting/hdi/github_audit_rule.rb

Overview

This rule checks for the MegaLinter workflow action and README badge.

Instance Method Summary collapse

Instance Method Details

#validateObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/way_of_working/code_linting/hdi/github_audit_rule.rb', line 13

def validate
  workflows = @client.workflows(@repo_name).workflows
  @errors << 'No HDI MegaLinter GitHub Action' unless workflows.map(&:name).include?('MegaLinter')

  @errors << 'No HDI MegaLinter README Badge' unless megalinter_badge?

  validate_repo_file_contains_source_file(
    '.github/linters/rubocop_defaults.yml',
    '.mega-linter.yml',
    '.rubocop'
  )
end