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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/claws/rule/global_permissions_block.rb +10 -2
- data/lib/claws/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6b391e0e7bd1ca6d4aa75feb0cec5153e04f6e67add1091e6b5598457e8c302f
|
|
4
|
+
data.tar.gz: b8cbceff5a7faa2aaafddc877f7471314fc185c9ba5909a5716ce4a51e2ce2ee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b5fbbba1250282c7e92395a8f2120e31b4f4376ff0949b9cabe200c0d774ef10c517684f144d0947cdabd7aeca2b64d03912c9089c776dfc85c63324ab51fd78
|
|
7
|
+
data.tar.gz: 2d11e730351d6f719068461646b7e70eb9dae159130b6a9f617e052b85f49cd254e6d0c2b6e57023ef37a1c738177ab9c4f82533ba8b1cd46f6406e176707a5b
|
data/Gemfile.lock
CHANGED
|
@@ -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
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.
|
|
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:
|
|
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.
|
|
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: []
|