bitwarden_workflow_linter 0.14.3__py3-none-any.whl → 0.14.4__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/default_settings.yaml +1 -0
- bitwarden_workflow_linter/rules/check_pr_target.py +6 -10
- bitwarden_workflow_linter/utils.py +8 -1
- {bitwarden_workflow_linter-0.14.3.dist-info → bitwarden_workflow_linter-0.14.4.dist-info}/METADATA +1 -1
- {bitwarden_workflow_linter-0.14.3.dist-info → bitwarden_workflow_linter-0.14.4.dist-info}/RECORD +9 -9
- {bitwarden_workflow_linter-0.14.3.dist-info → bitwarden_workflow_linter-0.14.4.dist-info}/WHEEL +0 -0
- {bitwarden_workflow_linter-0.14.3.dist-info → bitwarden_workflow_linter-0.14.4.dist-info}/entry_points.txt +0 -0
- {bitwarden_workflow_linter-0.14.3.dist-info → bitwarden_workflow_linter-0.14.4.dist-info}/licenses/LICENSE.txt +0 -0
@@ -27,16 +27,12 @@ class RuleCheckPrTarget(Rule):
|
|
27
27
|
self.compatibility = [Workflow]
|
28
28
|
self.settings = settings
|
29
29
|
|
30
|
-
def targets_main_branch(self, obj:Workflow) -> bool:
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
return False
|
37
|
-
else:
|
38
|
-
return False
|
39
|
-
return True
|
30
|
+
def targets_main_branch(self, obj: Workflow) -> bool:
|
31
|
+
default_branch = self.settings.default_branch
|
32
|
+
branches = obj.on["pull_request_target"].get("branches", [])
|
33
|
+
if isinstance(branches, str):
|
34
|
+
branches = [branches]
|
35
|
+
return len(branches) == 1 and branches[0] == default_branch
|
40
36
|
|
41
37
|
def has_check_run(self, obj: Workflow) -> Tuple[bool, str]:
|
42
38
|
for name, job in obj.jobs.items():
|
@@ -113,12 +113,14 @@ class Settings:
|
|
113
113
|
enabled_rules: list[dict[str, str]]
|
114
114
|
approved_actions: dict[str, Action]
|
115
115
|
actionlint_version: str
|
116
|
+
default_branch: Optional[str]
|
116
117
|
|
117
118
|
def __init__(
|
118
119
|
self,
|
119
120
|
enabled_rules: Optional[list[dict[str, str]]] = None,
|
120
121
|
approved_actions: Optional[dict[str, dict[str, str]]] = None,
|
121
122
|
actionlint_version: Optional[str] = None,
|
123
|
+
default_branch: Optional[str] = None,
|
122
124
|
) -> None:
|
123
125
|
"""Settings object that can be overridden in settings.py.
|
124
126
|
|
@@ -144,6 +146,7 @@ class Settings:
|
|
144
146
|
self.approved_actions = {
|
145
147
|
name: Action(**action) for name, action in approved_actions.items()
|
146
148
|
}
|
149
|
+
self.default_branch = default_branch
|
147
150
|
|
148
151
|
@staticmethod
|
149
152
|
def factory() -> SettingsFromFactory:
|
@@ -189,9 +192,13 @@ class Settings:
|
|
189
192
|
) as action_file:
|
190
193
|
settings["approved_actions"] = json.load(action_file)
|
191
194
|
|
192
|
-
|
195
|
+
default_branch = settings.get("default_branch")
|
196
|
+
if default_branch is None or len(default_branch) == 0:
|
197
|
+
raise Exception("The default_branch is not set in the default_settings.yaml file")
|
198
|
+
|
193
199
|
return Settings(
|
194
200
|
enabled_rules=settings["enabled_rules"],
|
195
201
|
approved_actions=settings["approved_actions"],
|
196
202
|
actionlint_version=actionlint_version,
|
203
|
+
default_branch=default_branch,
|
197
204
|
)
|
{bitwarden_workflow_linter-0.14.3.dist-info → bitwarden_workflow_linter-0.14.4.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.4
|
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.3.dist-info → bitwarden_workflow_linter-0.14.4.dist-info}/RECORD
RENAMED
@@ -1,20 +1,20 @@
|
|
1
|
-
bitwarden_workflow_linter/__about__.py,sha256=
|
1
|
+
bitwarden_workflow_linter/__about__.py,sha256=eX54GJCBJkSf7DXCV33XCflQekKuARWHyPT6C64mIEg,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
|
5
5
|
bitwarden_workflow_linter/cli.py,sha256=wgkK1MlVbo6Zx3f2CZZ_tkSWq_hdsGciHJA1knX6Yuw,1699
|
6
6
|
bitwarden_workflow_linter/default_actions.json,sha256=gfnuWVJwBOnig50x4YTUcrseaxaOVGyFDcYfQVK6Two,13650
|
7
|
-
bitwarden_workflow_linter/default_settings.yaml,sha256=
|
7
|
+
bitwarden_workflow_linter/default_settings.yaml,sha256=EoIQVnZ_WXzoaMyXQjtcNatIXRey2HSfe2ROUlyvSwg,1065
|
8
8
|
bitwarden_workflow_linter/lint.py,sha256=R0dXkwir0KzXFHWfWlqpH_CyBwa7O8wHSBTy560u94g,6322
|
9
9
|
bitwarden_workflow_linter/load.py,sha256=FWxotIlB0vyKzrVw87sOx3qdRiJG_0hVHRbbLXZY4Sc,5553
|
10
10
|
bitwarden_workflow_linter/rule.py,sha256=Qb60JiUDAWN3ayrMGoSbbDCSFmw-ql8djzAkxISaob4,3250
|
11
|
-
bitwarden_workflow_linter/utils.py,sha256=
|
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
13
|
bitwarden_workflow_linter/models/job.py,sha256=d4F0QG35DqaqgfbPa2YDRRxOZZakFDktIOsuUa-BbC8,2387
|
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
|
17
|
-
bitwarden_workflow_linter/rules/check_pr_target.py,sha256=
|
17
|
+
bitwarden_workflow_linter/rules/check_pr_target.py,sha256=lleDloCukjRAI0d54Ne8-yVMw9aNEqB5pGb9cNBuC8k,3430
|
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
|
@@ -24,8 +24,8 @@ bitwarden_workflow_linter/rules/run_actionlint.py,sha256=m6SaejtkUz704exAiq_ti0d
|
|
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.4.dist-info/METADATA,sha256=VngHeLubR54BIBsrwgyJrrqiNW5G0RGD4rJAlZYYWFQ,9797
|
28
|
+
bitwarden_workflow_linter-0.14.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
29
|
+
bitwarden_workflow_linter-0.14.4.dist-info/entry_points.txt,sha256=SA_yF9CwL4VMUvdcmCd7k9rjsQNzfeOUBuDnMnaO8QQ,60
|
30
|
+
bitwarden_workflow_linter-0.14.4.dist-info/licenses/LICENSE.txt,sha256=uY-7N9tbI7xc_c0WeTIGpacSCnsB91N05eCIg3bkaRw,35140
|
31
|
+
bitwarden_workflow_linter-0.14.4.dist-info/RECORD,,
|
{bitwarden_workflow_linter-0.14.3.dist-info → bitwarden_workflow_linter-0.14.4.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|