bitwarden_workflow_linter 0.3.0__py3-none-any.whl → 0.4.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.3.0"
3
+ __version__ = "0.4.0"
@@ -57,17 +57,22 @@ class ActionsCmd:
57
57
  parser_actions = subparsers.add_parser(
58
58
  "actions", help="!!BETA!!\nAdd or Update Actions in the pre-approved list."
59
59
  )
60
- parser_actions.add_argument(
61
- "-o", "--output", action="store", default="actions.json"
62
- )
63
60
  subparsers_actions = parser_actions.add_subparsers(
64
61
  required=True, dest="actions_command"
65
62
  )
66
- subparsers_actions.add_parser("update", help="update action versions")
63
+ parser_actions_update = subparsers_actions.add_parser(
64
+ "update", help="update action versions"
65
+ )
66
+ parser_actions_update.add_argument(
67
+ "-o", "--output", action="store", default="actions.json", help="output file"
68
+ )
67
69
  parser_actions_add = subparsers_actions.add_parser(
68
70
  "add", help="add action to approved list"
69
71
  )
70
72
  parser_actions_add.add_argument("name", help="action name [git owner/repo]")
73
+ parser_actions_add.add_argument(
74
+ "-o", "--output", action="store", default="actions.json", help="output file"
75
+ )
71
76
 
72
77
  return subparsers
73
78
 
@@ -127,29 +132,38 @@ class ActionsCmd:
127
132
  f"https://api.github.com/repos/{action.name}/releases/latest",
128
133
  action.name,
129
134
  )
130
- if not response:
131
- return None
135
+ if response is not None and response.status != 404:
136
+ tag_name = json.loads(response.data)["tag_name"]
132
137
 
133
- tag_name = json.loads(response.data)["tag_name"]
138
+ # Get the URL to the commit for the tag
139
+ response = self.get_github_api_response(
140
+ f"https://api.github.com/repos/{action.name}/git/ref/tags/{tag_name}",
141
+ action.name,
142
+ )
134
143
 
135
- # Get the URL to the commit for the tag
136
- response = self.get_github_api_response(
137
- f"https://api.github.com/repos/{action.name}/git/ref/tags/{tag_name}",
138
- action.name,
139
- )
140
- if not response:
141
- return None
144
+ if response is None or response.status != 200:
145
+ return None
146
+
147
+ if json.loads(response.data)["object"]["type"] != "commit":
148
+ url = json.loads(response.data)["object"]["url"]
149
+ # Follow the URL and get the commit sha for tags
150
+ response = self.get_github_api_response(url, action.name)
151
+ if not response:
152
+ return None
142
153
 
143
- if json.loads(response.data)["object"]["type"] == "commit":
144
154
  sha = json.loads(response.data)["object"]["sha"]
145
155
  else:
146
- url = json.loads(response.data)["object"]["url"]
147
- # Follow the URL and get the commit sha for tags
148
- response = self.get_github_api_response(url, action.name)
149
- if not response:
156
+ # Get tag from latest tag
157
+ response = self.get_github_api_response(
158
+ f"https://api.github.com/repos/{action.name}/tags",
159
+ action.name,
160
+ )
161
+
162
+ if response is None or response.status != 200:
150
163
  return None
151
164
 
152
- sha = json.loads(response.data)["object"]["sha"]
165
+ sha = json.loads(response.data)[0]["commit"]["sha"]
166
+ tag_name = json.loads(response.data)[0]["name"]
153
167
  except KeyError as err:
154
168
  raise GitHubApiSchemaError(
155
169
  f"Error with the GitHub API Response Schema for either /releases or"
@@ -182,10 +196,20 @@ class ActionsCmd:
182
196
  updated_actions = self.settings.approved_actions
183
197
  proposed_action = Action(name=new_action_name)
184
198
 
199
+ # Remove the action directory if the action is in a multi-actions repo
200
+ if len(new_action_name.split("/")) > 2:
201
+ modified_action = "/".join(new_action_name.split("/")[:-1])
202
+ print(
203
+ f" - {new_action_name} \033[{Colors.yellow}modified\033[0m to {modified_action}"
204
+ )
205
+ proposed_action = Action(name=modified_action)
206
+
185
207
  if self.exists(proposed_action):
186
208
  latest = self.get_latest_version(proposed_action)
187
209
  if latest:
188
210
  updated_actions[latest.name] = latest
211
+ else:
212
+ print(f" - {new_action_name} \033[{Colors.red}not found\033[0m")
189
213
 
190
214
  self.save_actions(updated_actions, filename)
191
215
  return 0
@@ -6,8 +6,8 @@
6
6
  },
7
7
  "Azure/functions-action": {
8
8
  "name": "Azure/functions-action",
9
- "sha": "238dc3c45bb1b04e5d16ff9e75cddd1d86753bd6",
10
- "version": "v1.5.1"
9
+ "sha": "fd80521afbba9a2a76a99ba1acc07aff8d733d11",
10
+ "version": "v1.5.2"
11
11
  },
12
12
  "Azure/get-keyvault-secrets": {
13
13
  "name": "Azure/get-keyvault-secrets",
@@ -16,13 +16,18 @@
16
16
  },
17
17
  "Azure/login": {
18
18
  "name": "Azure/login",
19
- "sha": "de95379fe4dadc2defb305917eaa7e5dde727294",
20
- "version": "v1.5.1"
19
+ "sha": "a65d910e8af852a8061c627c456678983e180302",
20
+ "version": "v2.2.0"
21
+ },
22
+ "Azure/setup-helm": {
23
+ "name": "Azure/setup-helm",
24
+ "sha": "fe7b79cd5ee1e45176fcad797de68ecaf3ca4814",
25
+ "version": "v4.2.0"
21
26
  },
22
27
  "Swatinem/rust-cache": {
23
28
  "name": "Swatinem/rust-cache",
24
- "sha": "a95ba195448af2da9b00fb742d14ffaaf3c21f43",
25
- "version": "v2.7.0"
29
+ "sha": "82a92a6e8fbeee089604da2575dc567ae9ddeaab",
30
+ "version": "v2.7.5"
26
31
  },
27
32
  "SwiftDocOrg/github-wiki-publish-action": {
28
33
  "name": "SwiftDocOrg/github-wiki-publish-action",
@@ -36,28 +41,43 @@
36
41
  },
37
42
  "act10ns/slack": {
38
43
  "name": "act10ns/slack",
39
- "sha": "ed1309ab9862e57e9e583e51c7889486b9a00b0f",
40
- "version": "v2.0.0"
44
+ "sha": "44541246747a30eb3102d87f7a4cc5471b0ffb7d",
45
+ "version": "v2.1.0"
46
+ },
47
+ "actions-cool/check-user-permission": {
48
+ "name": "actions-cool/check-user-permission",
49
+ "sha": "956b2e73cdfe3bcb819bb7225e490cb3b18fd76e",
50
+ "version": "v2.2.1"
41
51
  },
42
52
  "actions/cache": {
43
53
  "name": "actions/cache",
44
- "sha": "704facf57e6136b1bc63b828d79edcd491f0ee84",
45
- "version": "v3.3.2"
54
+ "sha": "1bd1e32a3bdc45362d1e726936510720a7c30a57",
55
+ "version": "v4.2.0"
46
56
  },
47
57
  "actions/checkout": {
48
58
  "name": "actions/checkout",
49
- "sha": "b4ffde65f46336ab88eb53be808477a3936bae11",
50
- "version": "v4.1.1"
59
+ "sha": "11bd71901bbe5b1630ceea73d27597364c9af683",
60
+ "version": "v4.2.2"
61
+ },
62
+ "actions/create-github-app-token": {
63
+ "name": "actions/create-github-app-token",
64
+ "sha": "5d869da34e18e7287c1daad50e0b8ea0f506ce69",
65
+ "version": "v1.11.0"
51
66
  },
52
67
  "actions/delete-package-versions": {
53
68
  "name": "actions/delete-package-versions",
54
- "sha": "0d39a63126868f5eefaa47169615edd3c0f61e20",
55
- "version": "v4.1.1"
69
+ "sha": "e5bc658cc4c965c472efe991f8beea3981499c55",
70
+ "version": "v5.0.0"
71
+ },
72
+ "actions/deploy-pages": {
73
+ "name": "actions/deploy-pages",
74
+ "sha": "d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e",
75
+ "version": "v4.0.5"
56
76
  },
57
77
  "actions/download-artifact": {
58
78
  "name": "actions/download-artifact",
59
- "sha": "f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110",
60
- "version": "v4.1.0"
79
+ "sha": "fa0a91b85d4f404e444e00e005971372dc801d16",
80
+ "version": "v4.1.8"
61
81
  },
62
82
  "actions/github-script": {
63
83
  "name": "actions/github-script",
@@ -71,23 +91,23 @@
71
91
  },
72
92
  "actions/setup-dotnet": {
73
93
  "name": "actions/setup-dotnet",
74
- "sha": "4d6c8fcf3c8f7a60068d26b594648e99df24cee3",
75
- "version": "v4.0.0"
94
+ "sha": "3e891b0cb619bf60e2c25674b222b8940e2c1c25",
95
+ "version": "v4.1.0"
76
96
  },
77
97
  "actions/setup-java": {
78
98
  "name": "actions/setup-java",
79
- "sha": "387ac29b308b003ca37ba93a6cab5eb57c8f5f93",
80
- "version": "v4.0.0"
99
+ "sha": "8df1039502a15bceb9433410b1a100fbe190c53b",
100
+ "version": "v4.5.0"
81
101
  },
82
102
  "actions/setup-node": {
83
103
  "name": "actions/setup-node",
84
- "sha": "b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8",
85
- "version": "v4.0.1"
104
+ "sha": "39370e3970a6d050c480ffad4ff0ed4d3fdee5af",
105
+ "version": "v4.1.0"
86
106
  },
87
107
  "actions/setup-python": {
88
108
  "name": "actions/setup-python",
89
- "sha": "0a5c61591373683505ea898e09a3ea4f39ef2b9c",
90
- "version": "v5.0.0"
109
+ "sha": "0b93645e9fea7318ecaed2b359559ac225c90a2b",
110
+ "version": "v5.3.0"
91
111
  },
92
112
  "actions/stale": {
93
113
  "name": "actions/stale",
@@ -96,18 +116,33 @@
96
116
  },
97
117
  "actions/upload-artifact": {
98
118
  "name": "actions/upload-artifact",
99
- "sha": "c7d193f32edcb7bfad88892161225aeda64e9392",
100
- "version": "v4.0.0"
119
+ "sha": "b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882",
120
+ "version": "v4.4.3"
121
+ },
122
+ "actions/upload-pages-artifact": {
123
+ "name": "actions/upload-pages-artifact",
124
+ "sha": "56afc609e74202658d3ffba0e8f6dda462b719fa",
125
+ "version": "v3.0.1"
126
+ },
127
+ "anchore/scan-action": {
128
+ "name": "anchore/scan-action",
129
+ "sha": "869c549e657a088dc0441b08ce4fc0ecdac2bb65",
130
+ "version": "v5.3.0"
101
131
  },
102
132
  "android-actions/setup-android": {
103
133
  "name": "android-actions/setup-android",
104
- "sha": "07976c6290703d34c16d382cb36445f98bb43b1f",
105
- "version": "v3.2.0"
134
+ "sha": "9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407",
135
+ "version": "v3.2.2"
136
+ },
137
+ "andymckay/labeler": {
138
+ "name": "andymckay/labeler",
139
+ "sha": "e6c4322d0397f3240f0e7e30a33b5c5df2d39e90",
140
+ "version": "1.0.4"
106
141
  },
107
142
  "azure/webapps-deploy": {
108
143
  "name": "azure/webapps-deploy",
109
- "sha": "145a0687697df1d8a28909569f6e5d86213041f9",
110
- "version": "v3.0.0"
144
+ "sha": "de617f46172a906d0617bb0e50d81e9e3aec24c8",
145
+ "version": "v3.0.1"
111
146
  },
112
147
  "bitwarden/sm-action": {
113
148
  "name": "bitwarden/sm-action",
@@ -116,22 +151,22 @@
116
151
  },
117
152
  "checkmarx/ast-github-action": {
118
153
  "name": "checkmarx/ast-github-action",
119
- "sha": "72d549beebd0bc5bbafa559f198161b6ce7c03df",
120
- "version": "2.0.21"
154
+ "sha": "b74e8d514feae4ad5ad2b43e72590935bd2daf5f",
155
+ "version": "2.0.39"
121
156
  },
122
157
  "chrnorm/deployment-action": {
123
158
  "name": "chrnorm/deployment-action",
124
- "sha": "d42cde7132fcec920de534fffc3be83794335c00",
125
- "version": "v2.0.5"
159
+ "sha": "55729fcebec3d284f60f5bcabbd8376437d696b1",
160
+ "version": "v2.0.7"
126
161
  },
127
162
  "chrnorm/deployment-status": {
128
163
  "name": "chrnorm/deployment-status",
129
- "sha": "2afb7d27101260f4a764219439564d954d10b5b0",
130
- "version": "v2.0.1"
164
+ "sha": "9a72af4586197112e0491ea843682b5dc280d806",
165
+ "version": "v2.0.3"
131
166
  },
132
167
  "chromaui/action": {
133
168
  "name": "chromaui/action",
134
- "sha": "80bf5911f28005ed208f15b7268843b79ca0e23a",
169
+ "sha": "e90c5a5e3bc2eb3b8e110d606f56a0f44fa47700",
135
170
  "version": "v1"
136
171
  },
137
172
  "cloudflare/pages-action": {
@@ -139,6 +174,16 @@
139
174
  "sha": "f0a1cd58cd66095dee69bfa18fa5efd1dde93bca",
140
175
  "version": "v1.5.0"
141
176
  },
177
+ "codecov/codecov-action": {
178
+ "name": "codecov/codecov-action",
179
+ "sha": "7f8b4b4bde536c465e797be725718b88c5d95e0e",
180
+ "version": "v5.1.1"
181
+ },
182
+ "codecov/test-results-action": {
183
+ "name": "codecov/test-results-action",
184
+ "sha": "9739113ad922ea0a9abb4b2c0f8bf6a4aa8ef820",
185
+ "version": "v1.0.1"
186
+ },
142
187
  "convictional/trigger-workflow-and-wait": {
143
188
  "name": "convictional/trigger-workflow-and-wait",
144
189
  "sha": "f69fa9eedd3c62a599220f4d5745230e237904be",
@@ -146,48 +191,48 @@
146
191
  },
147
192
  "crazy-max/ghaction-import-gpg": {
148
193
  "name": "crazy-max/ghaction-import-gpg",
149
- "sha": "01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4",
150
- "version": "v6.1.0"
194
+ "sha": "cb9bde2e2525e640591a934b1fd28eef1dcaf5e5",
195
+ "version": "v6.2.0"
151
196
  },
152
197
  "crowdin/github-action": {
153
198
  "name": "crowdin/github-action",
154
- "sha": "fdc55cdc519e86e32c22a07528d649277f1127f2",
155
- "version": "v1.16.0"
199
+ "sha": "a9ffb7d5ac46eca1bb1f06656bf888b39462f161",
200
+ "version": "v2.4.0"
156
201
  },
157
202
  "dawidd6/action-download-artifact": {
158
203
  "name": "dawidd6/action-download-artifact",
159
- "sha": "e7466d1a7587ed14867642c2ca74b5bcc1e19a2d",
160
- "version": "v3.0.0"
204
+ "sha": "80620a5d27ce0ae443b965134db88467fc607b43",
205
+ "version": "v7"
161
206
  },
162
207
  "dawidd6/action-homebrew-bump-formula": {
163
208
  "name": "dawidd6/action-homebrew-bump-formula",
164
- "sha": "75ed025ff3ad1d617862838b342b06d613a0ddf3",
165
- "version": "v3.10.1"
209
+ "sha": "8d494330bce4434918392df134ad3db1167904db",
210
+ "version": "v4"
166
211
  },
167
212
  "digitalocean/action-doctl": {
168
213
  "name": "digitalocean/action-doctl",
169
- "sha": "e5cb5b0cde9789f79c5115c2c4d902f38a708804",
170
- "version": "v2.5.0"
214
+ "sha": "135ac0aa0eed4437d547c6f12c364d3006b42824",
215
+ "version": "v2.5.1"
171
216
  },
172
217
  "docker/build-push-action": {
173
218
  "name": "docker/build-push-action",
174
- "sha": "4a13e500e55cf31b7a5d59a38ab2040ab0f42f56",
175
- "version": "v5.1.0"
219
+ "sha": "48aba3b46d1b1fec4febb7c5d0c644b249a11355",
220
+ "version": "v6.10.0"
176
221
  },
177
222
  "docker/setup-buildx-action": {
178
223
  "name": "docker/setup-buildx-action",
179
- "sha": "f95db51fddba0c2d1ec667646a06c2ce06100226",
180
- "version": "v3.0.0"
224
+ "sha": "c47758b77c9736f4b2ef4073d4d51994fabfe349",
225
+ "version": "v3.7.1"
181
226
  },
182
227
  "docker/setup-qemu-action": {
183
228
  "name": "docker/setup-qemu-action",
184
- "sha": "68827325e0b33c7199eb31dd4e31fbe9023e06e3",
185
- "version": "v3.0.0"
229
+ "sha": "49b3bc8e6bdd4a60e6116a5414239cba5943d3cf",
230
+ "version": "v3.2.0"
186
231
  },
187
232
  "dorny/test-reporter": {
188
233
  "name": "dorny/test-reporter",
189
- "sha": "afe6793191b75b608954023a46831a3fe10048d4",
190
- "version": "v1.7.0"
234
+ "sha": "31a54ee7ebcacc03a09ea97a7e5465a47b84aea5",
235
+ "version": "v1.9.1"
191
236
  },
192
237
  "dtolnay/rust-toolchain": {
193
238
  "name": "dtolnay/rust-toolchain",
@@ -196,68 +241,128 @@
196
241
  },
197
242
  "futureware-tech/simulator-action": {
198
243
  "name": "futureware-tech/simulator-action",
199
- "sha": "bfa03d93ec9de6dacb0c5553bbf8da8afc6c2ee9",
200
- "version": "v3"
244
+ "sha": "dab10d813144ef59b48d401cd95da151222ef8cd",
245
+ "version": "v4"
246
+ },
247
+ "github/codeql-action": {
248
+ "name": "github/codeql-action",
249
+ "sha": "3096afedf9873361b2b2f65e1445b13272c83eb8",
250
+ "version": "codeql-bundle-v2.20.0"
251
+ },
252
+ "gradle/actions": {
253
+ "name": "gradle/actions",
254
+ "sha": "cc4fc85e6b35bafd578d5ffbc76a5518407e1af0",
255
+ "version": "v4.2.1"
201
256
  },
202
257
  "hashicorp/setup-packer": {
203
258
  "name": "hashicorp/setup-packer",
204
- "sha": "ecc5516821087666a672c0d280a0084ea6d9aafd",
205
- "version": "v2.0.1"
259
+ "sha": "1aa358be5cf73883762b302a3a03abd66e75b232",
260
+ "version": "v3.1.0"
261
+ },
262
+ "helm/chart-releaser-action": {
263
+ "name": "helm/chart-releaser-action",
264
+ "sha": "a917fd15b20e8b64b94d9158ad54cd6345335584",
265
+ "version": "v1.6.0"
266
+ },
267
+ "helm/chart-testing-action": {
268
+ "name": "helm/chart-testing-action",
269
+ "sha": "e6669bcd63d7cb57cb4380c33043eebe5d111992",
270
+ "version": "v2.6.1"
271
+ },
272
+ "helm/kind-action": {
273
+ "name": "helm/kind-action",
274
+ "sha": "0025e74a8c7512023d06dc019c617aa3cf561fde",
275
+ "version": "v1.10.0"
276
+ },
277
+ "launchdarkly/find-code-references-in-pull-request": {
278
+ "name": "launchdarkly/find-code-references-in-pull-request",
279
+ "sha": "d008aa4f321d8cd35314d9cb095388dcfde84439",
280
+ "version": "v2.0.0"
206
281
  },
207
282
  "macauley/action-homebrew-bump-cask": {
208
283
  "name": "macauley/action-homebrew-bump-cask",
209
284
  "sha": "445c42390d790569d938f9068d01af39ca030feb",
210
285
  "version": "v1.0.0"
211
286
  },
212
- "maxim-lobanov/setup-xcode" : {
287
+ "maxim-lobanov/setup-xcode": {
213
288
  "name": "maxim-lobanov/setup-xcode",
214
289
  "sha": "60606e260d2fc5762a71e64e74b2174e8ea3c8bd",
215
290
  "version": "v1.6.0"
216
291
  },
217
292
  "microsoft/setup-msbuild": {
218
293
  "name": "microsoft/setup-msbuild",
219
- "sha": "1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c",
220
- "version": "v1.3.1"
294
+ "sha": "6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce",
295
+ "version": "v2"
221
296
  },
222
297
  "ncipollo/release-action": {
223
298
  "name": "ncipollo/release-action",
224
- "sha": "6c75be85e571768fa31b40abf38de58ba0397db5",
225
- "version": "v1.13.0"
299
+ "sha": "2c591bcc8ecdcd2db72b97d6147f871fcd833ba5",
300
+ "version": "v1.14.0"
226
301
  },
227
302
  "peter-evans/close-issue": {
228
303
  "name": "peter-evans/close-issue",
229
304
  "sha": "276d7966e389d888f011539a86c8920025ea0626",
230
305
  "version": "v3.0.1"
231
306
  },
307
+ "reactivecircus/android-emulator-runner": {
308
+ "name": "reactivecircus/android-emulator-runner",
309
+ "sha": "62dbb605bba737720e10b196cb4220d374026a6d",
310
+ "version": "v2.33.0"
311
+ },
232
312
  "ruby/setup-ruby": {
233
313
  "name": "ruby/setup-ruby",
234
- "sha": "360dc864d5da99d54fcb8e9148c14a84b90d3e88",
235
- "version": "v1.165.1"
314
+ "sha": "2a18b06812b0e15bb916e1df298d3e740422c47e",
315
+ "version": "v1.203.0"
236
316
  },
237
317
  "samuelmeuli/action-snapcraft": {
238
318
  "name": "samuelmeuli/action-snapcraft",
239
319
  "sha": "d33c176a9b784876d966f80fb1b461808edc0641",
240
320
  "version": "v2.1.1"
241
321
  },
322
+ "slackapi/slack-github-action": {
323
+ "name": "slackapi/slack-github-action",
324
+ "sha": "485a9d42d3a73031f12ec201c457e2162c45d02d",
325
+ "version": "v2.0.0"
326
+ },
327
+ "sigstore/cosign-installer": {
328
+ "name": "sigstore/cosign-installer",
329
+ "sha": "dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da",
330
+ "version": "v3.7.0"
331
+ },
242
332
  "snapcore/action-build": {
243
333
  "name": "snapcore/action-build",
244
- "sha": "2096990827aa966f773676c8a53793c723b6b40f",
245
- "version": "v1.2.0"
334
+ "sha": "3bdaa03e1ba6bf59a65f84a751d943d549a54e79",
335
+ "version": "v1.3.0"
336
+ },
337
+ "softprops/action-gh-release": {
338
+ "name": "softprops/action-gh-release",
339
+ "sha": "7b4da11513bf3f43f9999e90eabced41ab8bb048",
340
+ "version": "v2.2.0"
246
341
  },
247
342
  "sonarsource/sonarcloud-github-action": {
248
343
  "name": "sonarsource/sonarcloud-github-action",
249
- "sha": "49e6cd3b187936a73b8280d59ffd9da69df63ec9",
250
- "version": "v2.1.1"
344
+ "sha": "02ef91109b2d589e757aefcfb2854c2783fd7b19",
345
+ "version": "v4.0.0"
346
+ },
347
+ "sonarsource/sonarqube-scan-action": {
348
+ "name": "sonarsource/sonarqube-scan-action",
349
+ "sha": "bfd4e558cda28cda6b5defafb9232d191be8c203",
350
+ "version": "v4.2.1"
251
351
  },
252
352
  "stackrox/kube-linter-action": {
253
353
  "name": "stackrox/kube-linter-action",
254
- "sha": "ca0d55b925470deb5b04b556e6c4276ea94d03c3",
255
- "version": "v1.0.4"
354
+ "sha": "5792edc6a03735d592b13c08201711327a935735",
355
+ "version": "v1.0.5"
256
356
  },
257
357
  "tj-actions/changed-files": {
258
358
  "name": "tj-actions/changed-files",
259
- "sha": "716b1e13042866565e00e85fd4ec490e186c4a2f",
260
- "version": "v41.0.1"
359
+ "sha": "bab30c2299617f6615ec02a68b9a40d10bd21366",
360
+ "version": "v45.0.5"
361
+ },
362
+ "tyrrrz/action-http-request": {
363
+ "name": "tyrrrz/action-http-request",
364
+ "sha": "64c70c67f5ebc54d4c7ea09cbe3553322778afd5",
365
+ "version": "1.1.2"
261
366
  },
262
367
  "yogevbd/enforce-label-action": {
263
368
  "name": "yogevbd/enforce-label-action",
@@ -58,7 +58,13 @@ class RuleJobEnvironmentPrefix(Rule):
58
58
  incorrectly named environment variables.
59
59
  """
60
60
  correct = True
61
- allowed_envs = {"NODE_OPTION", "NUGET_PACKAGES", "MINT_PATH", "MINT_LINK_PATH"}
61
+ allowed_envs = {
62
+ "NODE_OPTIONS",
63
+ "NUGET_PACKAGES",
64
+ "MINT_PATH",
65
+ "MINT_LINK_PATH",
66
+ "HUSKY",
67
+ }
62
68
 
63
69
  if obj.env:
64
70
  offending_keys = []
@@ -70,4 +76,4 @@ class RuleJobEnvironmentPrefix(Rule):
70
76
  if correct:
71
77
  return True, ""
72
78
 
73
- return False, f"{self.message} ({' ,'.join(offending_keys)})"
79
+ return False, f"{self.message} ({', '.join(offending_keys)})"
@@ -1,5 +1,6 @@
1
1
  """A Rule to enforce all 'name' values start with a capital letter."""
2
2
 
3
+ import re
3
4
  from typing import Optional, Tuple, Union
4
5
 
5
6
  from ..models.job import Job
@@ -56,7 +57,7 @@ class RuleNameCapitalized(Rule):
56
57
  if obj.name[0] != "_":
57
58
  return obj.name[0].isupper(), self.message
58
59
  else:
59
- if obj.name:
60
+ if obj.name and not re.match(r"^\s*\${{\s*matrix\..*}}.*", obj.name):
60
61
  return obj.name[0].isupper(), self.message
61
62
 
62
63
  return True, "" # Force passing
@@ -23,7 +23,7 @@ class RuleStepUsesApproved(Rule):
23
23
  A Settings object that contains any default, overridden, or custom settings
24
24
  required anywhere in the application.
25
25
  """
26
- self.on_fail = LintLevels.WARNING
26
+ self.on_fail = LintLevels.ERROR
27
27
  self.compatibility = [Step]
28
28
  self.settings = settings
29
29
 
@@ -82,20 +82,17 @@ class RuleStepUsesApproved(Rule):
82
82
  if self.skip(obj):
83
83
  return True, ""
84
84
 
85
+ obj_path = obj.uses_path
86
+
87
+ # Remove the action directory if the action is in a multi-actions repo
88
+ if len(obj.uses_path.split("/")) > 2:
89
+ obj_path = "/".join(obj.uses_path.split("/")[:-1])
90
+
85
91
  # Actions in bitwarden/ are auto-approved
86
- if obj.uses and not obj.uses_path in self.settings.approved_actions:
92
+ if obj.uses and not obj_path in self.settings.approved_actions:
87
93
  return False, (
88
94
  f"New Action detected: {obj.uses_path}\nFor security purposes, "
89
95
  "actions must be reviewed and be on the pre-approved list"
90
96
  )
91
97
 
92
- action = self.settings.approved_actions[obj.uses_path]
93
-
94
- if obj.uses_version != action.version or obj.uses_ref != action.sha:
95
- return False, (
96
- "Action is out of date. Please update to:\n"
97
- f" commit: {action.version}"
98
- f" version: {action.sha}"
99
- )
100
-
101
98
  return True, ""
@@ -83,7 +83,7 @@ class RuleStepUsesPinned(Rule):
83
83
  path, ref = obj.uses.split("@")
84
84
 
85
85
  if path.startswith("bitwarden/"):
86
- if ref == "main":
86
+ if ref == "main" or "sm-action" in path:
87
87
  return True, ""
88
88
  return False, "Please pin to main"
89
89
 
@@ -103,14 +103,6 @@ class RuleUnderscoreOutputs(Rule):
103
103
  for output in obj.outputs.keys():
104
104
  outputs.append(output)
105
105
 
106
- if isinstance(obj, Step):
107
- if obj.run:
108
- outputs.extend(
109
- re.findall(
110
- r"\b([a-zA-Z0-9_-]+)\s*=\s*[^=]*>>\s*\$GITHUB_OUTPUT", obj.run
111
- )
112
- )
113
-
114
106
  correct = True
115
107
  offending_keys = []
116
108
 
@@ -124,5 +116,5 @@ class RuleUnderscoreOutputs(Rule):
124
116
 
125
117
  return (
126
118
  False,
127
- f"{obj.__class__.__name__} {self.message}: ({' ,'.join(offending_keys)})",
119
+ f"{obj.__class__.__name__} {self.message}: ({', '.join(offending_keys)})",
128
120
  )
@@ -1,9 +1,10 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: bitwarden_workflow_linter
3
- Version: 0.3.0
3
+ Version: 0.4.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
7
+ License-File: LICENSE.txt
7
8
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
8
9
  Classifier: Operating System :: OS Independent
9
10
  Classifier: Programming Language :: Python :: 3
@@ -1,8 +1,8 @@
1
- bitwarden_workflow_linter/__about__.py,sha256=6Jd6E8G5LxFTHCS3y8PQUh6kFPFKcdPKIowraU_efEY,59
1
+ bitwarden_workflow_linter/__about__.py,sha256=Y6syC77IGO4JxX2o2HH_kN6gjgT2uc81ztZluWcw9Ls,59
2
2
  bitwarden_workflow_linter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- bitwarden_workflow_linter/actions.py,sha256=daob3be2Y22gfsAmGhTgBRCgGk18mlGduqc5Zn1Onz4,7897
3
+ bitwarden_workflow_linter/actions.py,sha256=LAn3yQeMMmCOvJWeTn3dE1U2nyEJqIBMwESq3TtY9hE,9069
4
4
  bitwarden_workflow_linter/cli.py,sha256=wgkK1MlVbo6Zx3f2CZZ_tkSWq_hdsGciHJA1knX6Yuw,1699
5
- bitwarden_workflow_linter/default_actions.json,sha256=Xfg6TMtNRnPYlD_pM2fLtCmXJZ1BYTAKfne-9Uon53E,8246
5
+ bitwarden_workflow_linter/default_actions.json,sha256=-UcA7x5CmyJGdUEkfkHnHiVpFqffZ4XeojDp08GELJg,11600
6
6
  bitwarden_workflow_linter/default_settings.yaml,sha256=2VwOcB0g3v4A2Kt2UgGFM0TSpfd6S0oNA0SkTa5tGJA,576
7
7
  bitwarden_workflow_linter/lint.py,sha256=RDHv5jGeGCf5XIHE8jyqQET3-cFykl7223SQVS4Q3pg,5525
8
8
  bitwarden_workflow_linter/load.py,sha256=Ece2bwSSYeQ1xQQEjjqY6DlCkwznFYLG56VW_VTxU4E,4472
@@ -13,15 +13,15 @@ bitwarden_workflow_linter/models/job.py,sha256=nBK7_VYu6RRST7WLtdLsoRErl5j4Er8W9
13
13
  bitwarden_workflow_linter/models/step.py,sha256=1bKAtKZmHcO8O1e_HuoXxR1bwHDEXUssYo7EHOjY7QI,1711
14
14
  bitwarden_workflow_linter/models/workflow.py,sha256=MkqvIY4JX2eWFODNTodS_l4I8uUq08WCHy3C4kYcL0s,1395
15
15
  bitwarden_workflow_linter/rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- bitwarden_workflow_linter/rules/job_environment_prefix.py,sha256=HJeZhw1JVk4PTYZUY8C2j9wG5x5SqaNy_6WHHlZ_iM4,2531
17
- bitwarden_workflow_linter/rules/name_capitalized.py,sha256=XwRZ33OeQv_i7z_2Yf7TEgJNodOl5byXfegqfmhaTYQ,1914
16
+ bitwarden_workflow_linter/rules/job_environment_prefix.py,sha256=sY1cBU5AeBHWSyun7gwnoS0ycRyBMjjVo_2lvanBj7U,2612
17
+ bitwarden_workflow_linter/rules/name_capitalized.py,sha256=quuqXM_qg93UE8mQo1YQp8cQ_Fx6c2u03_19s_c0ntw,1981
18
18
  bitwarden_workflow_linter/rules/name_exists.py,sha256=MxcaNQz64JXeHRPiOip9BxJNgPdpKQa7Z51mDoNw2hU,1681
19
19
  bitwarden_workflow_linter/rules/pinned_job_runner.py,sha256=Dm6_sdPX0yFMji_y2LMFj4gWFaToEgauyBVpNRP2qiI,1606
20
- bitwarden_workflow_linter/rules/step_approved.py,sha256=MZN423Dsk_1DRDuLz7TE9BE0YbLmZbFEHgcoF1MrFGM,3277
21
- bitwarden_workflow_linter/rules/step_pinned.py,sha256=CSHbyeLx1uT8exRzOgFVc1dzMJGnbXhTHiteaoOLWUk,3390
22
- bitwarden_workflow_linter/rules/underscore_outputs.py,sha256=johfE2Qwb_ww4xbW5u-ug37wNZbHZgKdRYg339cxUR8,4381
23
- bitwarden_workflow_linter-0.3.0.dist-info/METADATA,sha256=Z6PQeT42vZx_emiBmPcharErkbda5qqbzpXyGFLfUlU,6146
24
- bitwarden_workflow_linter-0.3.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
25
- bitwarden_workflow_linter-0.3.0.dist-info/entry_points.txt,sha256=SA_yF9CwL4VMUvdcmCd7k9rjsQNzfeOUBuDnMnaO8QQ,60
26
- bitwarden_workflow_linter-0.3.0.dist-info/licenses/LICENSE.txt,sha256=uY-7N9tbI7xc_c0WeTIGpacSCnsB91N05eCIg3bkaRw,35140
27
- bitwarden_workflow_linter-0.3.0.dist-info/RECORD,,
20
+ bitwarden_workflow_linter/rules/step_approved.py,sha256=6XuYoasw2ME8vQu5G0ZygUSi7X5amLLWeXH81cqvKv8,3159
21
+ bitwarden_workflow_linter/rules/step_pinned.py,sha256=fyqBjarR0UNQ6tU_ja0ZOi2afP942BMqOz5nU_yKzmw,3413
22
+ bitwarden_workflow_linter/rules/underscore_outputs.py,sha256=w8pP1dTJEC9I2X5fQIAHDAEiaNP1xMhb4kPiF-dn8U0,4131
23
+ bitwarden_workflow_linter-0.4.0.dist-info/METADATA,sha256=q6VsW3ul6IUWvzc7B8iW4HmRYwyGSqW1v1sk8K0JCL4,6172
24
+ bitwarden_workflow_linter-0.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
25
+ bitwarden_workflow_linter-0.4.0.dist-info/entry_points.txt,sha256=SA_yF9CwL4VMUvdcmCd7k9rjsQNzfeOUBuDnMnaO8QQ,60
26
+ bitwarden_workflow_linter-0.4.0.dist-info/licenses/LICENSE.txt,sha256=uY-7N9tbI7xc_c0WeTIGpacSCnsB91N05eCIg3bkaRw,35140
27
+ bitwarden_workflow_linter-0.4.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.3
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any