bitwarden_workflow_linter 0.13.0__py3-none-any.whl → 0.14.0__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.
@@ -1,3 +1,3 @@
1
1
  """Metadata for Workflow Linter."""
2
2
 
3
- __version__ = "0.13.0"
3
+ __version__ = "0.14.0"
@@ -324,6 +324,11 @@
324
324
  "sha": "0025e74a8c7512023d06dc019c617aa3cf561fde",
325
325
  "version": "v1.10.0"
326
326
  },
327
+ "launchdarkly/find-code-references": {
328
+ "name": "launchdarkly/find-code-references",
329
+ "sha": "e3e9da201b87ada54eb4c550c14fb783385c5c8a",
330
+ "version": "v2.13.0"
331
+ },
327
332
  "launchdarkly/find-code-references-in-pull-request": {
328
333
  "name": "launchdarkly/find-code-references-in-pull-request",
329
334
  "sha": "d008aa4f321d8cd35314d9cb095388dcfde84439",
@@ -17,17 +17,12 @@ def install_actionlint(platform_system: str, version: str) -> Tuple[bool, str]:
17
17
 
18
18
  error = f"An error occurred when installing Actionlint on {platform_system}"
19
19
 
20
- if platform_system.startswith("Linux"):
20
+ if platform_system.startswith(("Linux", "Darwin")):
21
+ """Homebrew does not maintain non-latest versions of actionlint so Mac will install from source"""
21
22
  return install_actionlint_source(error,version)
22
- elif platform_system == "Darwin":
23
- try:
24
- subprocess.run(["brew", "install", "actionlint"], check=True)
25
- return True, ""
26
- except (FileNotFoundError, subprocess.CalledProcessError):
27
- return False, f"{error} : check Brew installation"
28
23
  elif platform_system.startswith("Win"):
29
24
  try:
30
- subprocess.run(["choco", "install", "actionlint", "-y"], check=True)
25
+ subprocess.run(["choco", "install", "actionlint", "-y", f"--version='{version}'"], check=True)
31
26
  return True, ""
32
27
  except (FileNotFoundError, subprocess.CalledProcessError):
33
28
  return False, f"{error} : check Choco installation"
@@ -42,21 +37,24 @@ def install_actionlint_source(error, version) -> Tuple[bool, str]:
42
37
  fp.write(request.read())
43
38
  try:
44
39
  subprocess.run(["bash", "download-actionlint.bash", version], check=True)
45
- return True, os.getcwd()
40
+ return True, "./actionlint"
46
41
  except (FileNotFoundError, subprocess.CalledProcessError):
47
42
  return False, error
48
43
 
49
44
 
50
- def check_actionlint(platform_system: str, version: str) -> Tuple[bool, str]:
45
+ def check_actionlint_path(platform_system: str, version: str) -> Tuple[bool, str]:
51
46
  """Check if the actionlint is in the system's PATH."""
52
47
  try:
53
- subprocess.run(
48
+ installed = subprocess.run(
54
49
  ["actionlint", "--version"],
55
50
  stdout=subprocess.PIPE,
56
51
  stderr=subprocess.PIPE,
57
52
  check=True,
58
53
  )
59
- return True, ""
54
+ if version in f"{installed}":
55
+ return True, ""
56
+ else:
57
+ return install_actionlint(platform_system, version)
60
58
  except subprocess.CalledProcessError:
61
59
  return (
62
60
  False,
@@ -64,7 +62,23 @@ def check_actionlint(platform_system: str, version: str) -> Tuple[bool, str]:
64
62
  please check your package installer or manually install it",
65
63
  )
66
64
  except FileNotFoundError:
67
- return install_actionlint(platform_system, version)
65
+ return check_actionlint_local(platform_system, version)
66
+
67
+ def check_actionlint_local(platform_system: str, version: str) -> Tuple[bool, str]:
68
+
69
+ try:
70
+ installed = subprocess.run(
71
+ ["./actionlint", "--version"],
72
+ stdout=subprocess.PIPE,
73
+ stderr=subprocess.PIPE,
74
+ check=True,
75
+ )
76
+ if version in f"{installed}":
77
+ return True, "./actionlint"
78
+ else:
79
+ return install_actionlint(platform_system, version)
80
+ except FileNotFoundError:
81
+ return install_actionlint(platform_system, version)
68
82
 
69
83
 
70
84
  class RunActionlint(Rule):
@@ -82,12 +96,15 @@ class RunActionlint(Rule):
82
96
  "Running actionlint without a filename is not currently supported"
83
97
  )
84
98
 
99
+ if not self.settings.actionlint_version:
100
+ raise KeyError("The 'actionlint_version' is missing in the configuration file.")
101
+
85
102
  """Check if Actionlint is alerady installed and if it is installed somewhere not on the PATH (location)"""
86
- installed, location = check_actionlint(platform.system(), self.settings.actionlint_version)
103
+ installed, location = check_actionlint_path(platform.system(), self.settings.actionlint_version)
87
104
  if installed:
88
105
  if location:
89
106
  result = subprocess.run(
90
- [location + "/actionlint", obj.filename],
107
+ [location, obj.filename],
91
108
  capture_output=True,
92
109
  text=True,
93
110
  check=False,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bitwarden_workflow_linter
3
- Version: 0.13.0
3
+ Version: 0.14.0
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
@@ -1,9 +1,9 @@
1
- bitwarden_workflow_linter/__about__.py,sha256=f5QTzIvY76oCTstHg8y_8_yGGrjcJvuwpeka56B-4eM,60
1
+ bitwarden_workflow_linter/__about__.py,sha256=iKLHnY0EebpVLhGhj38f36N-qmo_5Esa3YkkrZPom-Y,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
- bitwarden_workflow_linter/default_actions.json,sha256=gmjTUnLl1QpovMt5siNxP-qGkSNmXMSRvt4Ud1jne4c,13523
6
+ bitwarden_workflow_linter/default_actions.json,sha256=HVZBmTpRoo07Cen2mFUgECW4H4OAnRvSORpO4CStraw,13698
7
7
  bitwarden_workflow_linter/default_settings.yaml,sha256=XCaRFqdJ_lbNUDlPthySZzF0dGjnpW28iNSRQsJaJJE,1044
8
8
  bitwarden_workflow_linter/lint.py,sha256=R0dXkwir0KzXFHWfWlqpH_CyBwa7O8wHSBTy560u94g,6322
9
9
  bitwarden_workflow_linter/load.py,sha256=FWxotIlB0vyKzrVw87sOx3qdRiJG_0hVHRbbLXZY4Sc,5553
@@ -20,12 +20,12 @@ bitwarden_workflow_linter/rules/name_capitalized.py,sha256=lGHPi_Ix0DVSzGEdrUm2v
20
20
  bitwarden_workflow_linter/rules/name_exists.py,sha256=kdMIURN3u8qdDvw6YKxg7VF5bkzGxVVXAO3KAqY1-54,1826
21
21
  bitwarden_workflow_linter/rules/permissions_exist.py,sha256=_qOonJ0tyIH3Wp0e-0cppyVIbY9Sr7DuZPZdwxjYMaI,1432
22
22
  bitwarden_workflow_linter/rules/pinned_job_runner.py,sha256=VPQfMu3SgIFdl-B8wOXzzK6tMx2hWWSJbKL5KG3xcaI,1751
23
- bitwarden_workflow_linter/rules/run_actionlint.py,sha256=8ovmccFiWtqLJNE1_QO3rKgmnL8ss4dbnq1SC3t2OX4,4007
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.13.0.dist-info/METADATA,sha256=yYyaD29hRHP4Uuey5Idv-C-IsCCTylTpBs5AcMJwMNw,9797
28
- bitwarden_workflow_linter-0.13.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
29
- bitwarden_workflow_linter-0.13.0.dist-info/entry_points.txt,sha256=SA_yF9CwL4VMUvdcmCd7k9rjsQNzfeOUBuDnMnaO8QQ,60
30
- bitwarden_workflow_linter-0.13.0.dist-info/licenses/LICENSE.txt,sha256=uY-7N9tbI7xc_c0WeTIGpacSCnsB91N05eCIg3bkaRw,35140
31
- bitwarden_workflow_linter-0.13.0.dist-info/RECORD,,
27
+ bitwarden_workflow_linter-0.14.0.dist-info/METADATA,sha256=bDC8YKQLxRhi4IZEXB84SkqszkKz5Pfr0UqDVq4Zsx0,9797
28
+ bitwarden_workflow_linter-0.14.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
29
+ bitwarden_workflow_linter-0.14.0.dist-info/entry_points.txt,sha256=SA_yF9CwL4VMUvdcmCd7k9rjsQNzfeOUBuDnMnaO8QQ,60
30
+ bitwarden_workflow_linter-0.14.0.dist-info/licenses/LICENSE.txt,sha256=uY-7N9tbI7xc_c0WeTIGpacSCnsB91N05eCIg3bkaRw,35140
31
+ bitwarden_workflow_linter-0.14.0.dist-info/RECORD,,