Class: Claws::Rule::GlobalPermissionsBlock
- Defined in:
- lib/claws/rule/global_permissions_block.rb
Instance Attribute Summary
Attributes inherited from BaseRule
#configuration, #on_job, #on_step, #on_workflow
Instance Method Summary collapse
-
#test_root_level_permissions(workflow:, job:, step:) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument.
Methods inherited from BaseRule
#data, description, extract_value, #initialize, #inspect, #name, name, on_job, on_step, on_workflow, parse_rule, #to_s
Constructor Details
This class inherits a constructor from BaseRule
Instance Method Details
#test_root_level_permissions(workflow:, job:, step:) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/claws/rule/global_permissions_block.rb', line 20 def (workflow:, job:, step:) # rubocop:disable Lint/UnusedMethodArgument = workflow.keys.filter { |x| x == "permissions" }.first&.line return if .nil? job_count = workflow["jobs"]&.count || 0 return if job_count < 2 Violation.new( line: , description: ) end |