bitwarden_workflow_linter 0.14.4__py3-none-any.whl → 0.14.5__py3-none-any.whl
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.
- bitwarden_workflow_linter/__about__.py +1 -1
- bitwarden_workflow_linter/models/job.py +2 -0
- bitwarden_workflow_linter/rules/permissions_exist.py +11 -4
- {bitwarden_workflow_linter-0.14.4.dist-info → bitwarden_workflow_linter-0.14.5.dist-info}/METADATA +1 -1
- {bitwarden_workflow_linter-0.14.4.dist-info → bitwarden_workflow_linter-0.14.5.dist-info}/RECORD +8 -8
- {bitwarden_workflow_linter-0.14.4.dist-info → bitwarden_workflow_linter-0.14.5.dist-info}/WHEEL +0 -0
- {bitwarden_workflow_linter-0.14.4.dist-info → bitwarden_workflow_linter-0.14.5.dist-info}/entry_points.txt +0 -0
- {bitwarden_workflow_linter-0.14.4.dist-info → bitwarden_workflow_linter-0.14.5.dist-info}/licenses/LICENSE.txt +0 -0
@@ -32,6 +32,7 @@ class Job:
|
|
32
32
|
metadata=config(field_name="with"), default=None
|
33
33
|
)
|
34
34
|
outputs: Optional[CommentedMap] = None
|
35
|
+
permissions: Optional[object] = None # This can be a CommentedMap or a string
|
35
36
|
|
36
37
|
@classmethod
|
37
38
|
def parse_needs(cls: Self, value):
|
@@ -50,6 +51,7 @@ class Job:
|
|
50
51
|
"env": data["env"] if "env" in data else None,
|
51
52
|
"needs": Job.parse_needs(data["needs"]) if "needs" in data else None,
|
52
53
|
"outputs": data["outputs"] if "outputs" in data else None,
|
54
|
+
"permissions": data["permissions"] if "permissions" in data else None,
|
53
55
|
}
|
54
56
|
|
55
57
|
new_job = cls.from_dict(init_data)
|
@@ -3,6 +3,7 @@
|
|
3
3
|
from typing import Optional, Tuple
|
4
4
|
|
5
5
|
from ..models.workflow import Workflow
|
6
|
+
from ..models.job import Job
|
6
7
|
from ..rule import Rule
|
7
8
|
from ..utils import LintLevels, Settings
|
8
9
|
|
@@ -26,18 +27,24 @@ class RulePermissionsExist(Rule):
|
|
26
27
|
lint_level: Optional[LintLevels] = LintLevels.NONE,
|
27
28
|
) -> None:
|
28
29
|
self.message = (
|
29
|
-
"
|
30
|
+
"All workflows must specify permissions on either workflow or job level"
|
30
31
|
)
|
31
32
|
self.on_fail = lint_level
|
32
33
|
self.compatibility = [Workflow]
|
33
34
|
self.settings = settings
|
34
35
|
|
35
|
-
def
|
36
|
-
if
|
36
|
+
def permissions_exist_on_workflow(self, workflow: Workflow) -> bool:
|
37
|
+
if workflow.permissions is None:
|
37
38
|
return False
|
38
39
|
return True
|
39
40
|
|
41
|
+
def permissions_exist_on_jobs(self, jobs: list[Job]) -> bool:
|
42
|
+
for job in jobs:
|
43
|
+
if job.permissions is None:
|
44
|
+
return False
|
45
|
+
return True
|
46
|
+
|
40
47
|
def fn(self, obj: Workflow) -> Tuple[bool, str]:
|
41
|
-
if not self.
|
48
|
+
if not self.permissions_exist_on_workflow(obj) and not self.permissions_exist_on_jobs(obj.jobs.values()):
|
42
49
|
return False, f"{self.message}"
|
43
50
|
return True, ""
|
{bitwarden_workflow_linter-0.14.4.dist-info → bitwarden_workflow_linter-0.14.5.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: bitwarden_workflow_linter
|
3
|
-
Version: 0.14.
|
3
|
+
Version: 0.14.5
|
4
4
|
Summary: Custom GitHub Action Workflow Linter
|
5
5
|
Project-URL: Homepage, https://github.com/bitwarden/workflow-linter
|
6
6
|
Project-URL: Issues, https://github.com/bitwarden/workflow-linter/issues
|
{bitwarden_workflow_linter-0.14.4.dist-info → bitwarden_workflow_linter-0.14.5.dist-info}/RECORD
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
bitwarden_workflow_linter/__about__.py,sha256=
|
1
|
+
bitwarden_workflow_linter/__about__.py,sha256=2-qa0YjKWSCy2VJpGQ8Oyle8DLLT03zz8T-bUmc9qFI,60
|
2
2
|
bitwarden_workflow_linter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
bitwarden_workflow_linter/actionlint_version.yaml,sha256=CKhiDwaDBNCExOHTlcpiavfEgf01uG_tTPrgLRaj6_k,28
|
4
4
|
bitwarden_workflow_linter/actions.py,sha256=LAn3yQeMMmCOvJWeTn3dE1U2nyEJqIBMwESq3TtY9hE,9069
|
@@ -10,7 +10,7 @@ bitwarden_workflow_linter/load.py,sha256=FWxotIlB0vyKzrVw87sOx3qdRiJG_0hVHRbbLXZ
|
|
10
10
|
bitwarden_workflow_linter/rule.py,sha256=Qb60JiUDAWN3ayrMGoSbbDCSFmw-ql8djzAkxISaob4,3250
|
11
11
|
bitwarden_workflow_linter/utils.py,sha256=KV2Vo-hhNVRWOiIq_y-55li-noMt9F-FFgkJK-nUKJo,5823
|
12
12
|
bitwarden_workflow_linter/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
-
bitwarden_workflow_linter/models/job.py,sha256=
|
13
|
+
bitwarden_workflow_linter/models/job.py,sha256=oqFq8A4JGQplBlaDjUUFV9kWT5rh9A0V6FYGf0IaGg0,2553
|
14
14
|
bitwarden_workflow_linter/models/step.py,sha256=j81iWYWcNI9x55n1MOR0N6ogKaQ_4-CKu9LnI_fwEOE,1814
|
15
15
|
bitwarden_workflow_linter/models/workflow.py,sha256=lIgGI2cDwC2lTOM-k3fqKgceLdSJ6vhTLCAhaeoD-fc,1645
|
16
16
|
bitwarden_workflow_linter/rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -18,14 +18,14 @@ bitwarden_workflow_linter/rules/check_pr_target.py,sha256=lleDloCukjRAI0d54Ne8-y
|
|
18
18
|
bitwarden_workflow_linter/rules/job_environment_prefix.py,sha256=bdE8l4B5DQiCFVmblXTs4ptsHPGvjhJrR5ONo2kRY2U,2757
|
19
19
|
bitwarden_workflow_linter/rules/name_capitalized.py,sha256=lGHPi_Ix0DVSzGEdrUm2vAEQD4qQ8dxU1hddsCdqA2w,2126
|
20
20
|
bitwarden_workflow_linter/rules/name_exists.py,sha256=kdMIURN3u8qdDvw6YKxg7VF5bkzGxVVXAO3KAqY1-54,1826
|
21
|
-
bitwarden_workflow_linter/rules/permissions_exist.py,sha256=
|
21
|
+
bitwarden_workflow_linter/rules/permissions_exist.py,sha256=vjqyNF9il73JHlvKKlb9vzZ_g4LEPNKOO4-4OnHGCQ8,1737
|
22
22
|
bitwarden_workflow_linter/rules/pinned_job_runner.py,sha256=VPQfMu3SgIFdl-B8wOXzzK6tMx2hWWSJbKL5KG3xcaI,1751
|
23
23
|
bitwarden_workflow_linter/rules/run_actionlint.py,sha256=m6SaejtkUz704exAiq_ti0d1a0wtDBb7QJE0EsFINv4,4712
|
24
24
|
bitwarden_workflow_linter/rules/step_approved.py,sha256=4pUCrOlWomo43bwGBunORphv1RJzc3spRKgZ4VLtDS0,3304
|
25
25
|
bitwarden_workflow_linter/rules/step_pinned.py,sha256=MagV8LNdgRKyncmSdH9V-TlIcsdjzoDHDWqovzWon9E,3559
|
26
26
|
bitwarden_workflow_linter/rules/underscore_outputs.py,sha256=LoCsDN_EfQ8H9n5BfZ5xCe7BeHqJGPMcV0vo1c9YJcw,4275
|
27
|
-
bitwarden_workflow_linter-0.14.
|
28
|
-
bitwarden_workflow_linter-0.14.
|
29
|
-
bitwarden_workflow_linter-0.14.
|
30
|
-
bitwarden_workflow_linter-0.14.
|
31
|
-
bitwarden_workflow_linter-0.14.
|
27
|
+
bitwarden_workflow_linter-0.14.5.dist-info/METADATA,sha256=zzLK5AYnhzG9jd9U62TztYNHmt1vPEXTW4Z0M9DDRbo,9797
|
28
|
+
bitwarden_workflow_linter-0.14.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
29
|
+
bitwarden_workflow_linter-0.14.5.dist-info/entry_points.txt,sha256=SA_yF9CwL4VMUvdcmCd7k9rjsQNzfeOUBuDnMnaO8QQ,60
|
30
|
+
bitwarden_workflow_linter-0.14.5.dist-info/licenses/LICENSE.txt,sha256=uY-7N9tbI7xc_c0WeTIGpacSCnsB91N05eCIg3bkaRw,35140
|
31
|
+
bitwarden_workflow_linter-0.14.5.dist-info/RECORD,,
|
{bitwarden_workflow_linter-0.14.4.dist-info → bitwarden_workflow_linter-0.14.5.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|