claws-scan 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f59c144218053c0a586d12ef661dbdb5790cfa6ea2a5558853cca2bb96fd7ef
4
- data.tar.gz: 9480e82f69cf9483e3856262571af392d1470c7a55fedb69057c4e58e615ad42
3
+ metadata.gz: 6b391e0e7bd1ca6d4aa75feb0cec5153e04f6e67add1091e6b5598457e8c302f
4
+ data.tar.gz: b8cbceff5a7faa2aaafddc877f7471314fc185c9ba5909a5716ce4a51e2ce2ee
5
5
  SHA512:
6
- metadata.gz: '0918feded5a9e55e37a86c27b3776e2c6d4abf2bb1356d26be6adf4280331340a9fb1390e168837fd17f57c644b24039a02f49f48911d2c5881a5a17c1d04147'
7
- data.tar.gz: 803a7627dd4f5d910ed6c5c71a34e57ce0ede591d92c16a92b6e2ebdca291abd44a78b8e6e24c8a31a1b7c458c267968a2785b1a6ecdee010b3d19b2a556ba90
6
+ metadata.gz: b5fbbba1250282c7e92395a8f2120e31b4f4376ff0949b9cabe200c0d774ef10c517684f144d0947cdabd7aeca2b64d03912c9089c776dfc85c63324ab51fd78
7
+ data.tar.gz: 2d11e730351d6f719068461646b7e70eb9dae159130b6a9f617e052b85f49cd254e6d0c2b6e57023ef37a1c738177ab9c4f82533ba8b1cd46f6406e176707a5b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- claws-scan (0.10.0)
4
+ claws-scan (0.10.1)
5
5
  equation (~> 0.6)
6
6
  pry
7
7
  slop (~> 4.9)
@@ -9,7 +9,8 @@ module Claws
9
9
 
10
10
  This rule will flag workflows that have multiple jobs and a root level
11
11
  permissions block. If there is a root level permissions block but just one job,
12
- it will not be flagged.
12
+ it will not be flagged. An empty root level block (`permissions: {}`) grants
13
+ nothing and will not be flagged either.
13
14
 
14
15
  For more information:
15
16
  https://github.com/betterment/claws/blob/main/README.md#globalpermissionsblock
@@ -17,9 +18,10 @@ module Claws
17
18
 
18
19
  on_workflow :test_root_level_permissions
19
20
 
20
- def test_root_level_permissions(workflow:, job:, step:) # rubocop:disable Lint/UnusedMethodArgument
21
+ def test_root_level_permissions(workflow:, job:, step:) # rubocop:disable Lint/UnusedMethodArgument, Metrics/CyclomaticComplexity
21
22
  root_permission_block_line = workflow.keys.filter { |x| x == "permissions" }.first&.line
22
23
  return if root_permission_block_line.nil?
24
+ return if empty_permissions?(workflow.permissions)
23
25
 
24
26
  job_count = workflow["jobs"]&.count || 0
25
27
  return if job_count < 2
@@ -29,6 +31,12 @@ module Claws
29
31
  description:
30
32
  )
31
33
  end
34
+
35
+ private
36
+
37
+ def empty_permissions?(permissions)
38
+ permissions.is_a?(Hash) && permissions.empty?
39
+ end
32
40
  end
33
41
  end
34
42
  end
data/lib/claws/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Claws
4
- VERSION = "0.10.0"
4
+ VERSION = "0.10.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: claws-scan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Omar
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-10-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: equation
@@ -120,7 +119,6 @@ licenses: []
120
119
  metadata:
121
120
  homepage_uri: https://github.com/Betterment/claws
122
121
  source_code_uri: https://github.com/Betterment/claws
123
- post_install_message:
124
122
  rdoc_options: []
125
123
  require_paths:
126
124
  - lib
@@ -135,8 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
133
  - !ruby/object:Gem::Version
136
134
  version: '0'
137
135
  requirements: []
138
- rubygems_version: 3.4.20
139
- signing_key:
136
+ rubygems_version: 3.6.7
140
137
  specification_version: 4
141
138
  summary: Analyzes your Github Actions
142
139
  test_files: []