Class: WayOfWorking::InclusiveLanguage::Alex::GithubAuditRule

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

Overview

This rule checks for the Inclusive Language workflow action and README badge.

Instance Method Summary collapse

Instance Method Details

#validateObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/way_of_working/inclusive_language/alex/github_audit_rule.rb', line 11

def validate
  response = @client.workflows(@repo_name)

  unless response.workflows.map(&:name).include?('Inclusive Language')
    @errors << 'No Inclusive Language GitHub Action'
  end

  @errors << 'Default branch is named "master"' if @repo.default_branch == 'master'

  @errors << 'No Inclusive Language README Badge' unless inclusive_language_badge?
end