bitwarden_workflow_linter 0.2.1__py3-none-any.whl → 0.3.1__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.2.1"
3
+ __version__ = "0.3.1"
@@ -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,38 @@
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"
56
71
  },
57
72
  "actions/download-artifact": {
58
73
  "name": "actions/download-artifact",
59
- "sha": "f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110",
60
- "version": "v4.1.0"
74
+ "sha": "fa0a91b85d4f404e444e00e005971372dc801d16",
75
+ "version": "v4.1.8"
61
76
  },
62
77
  "actions/github-script": {
63
78
  "name": "actions/github-script",
@@ -71,23 +86,23 @@
71
86
  },
72
87
  "actions/setup-dotnet": {
73
88
  "name": "actions/setup-dotnet",
74
- "sha": "4d6c8fcf3c8f7a60068d26b594648e99df24cee3",
75
- "version": "v4.0.0"
89
+ "sha": "3e891b0cb619bf60e2c25674b222b8940e2c1c25",
90
+ "version": "v4.1.0"
76
91
  },
77
92
  "actions/setup-java": {
78
93
  "name": "actions/setup-java",
79
- "sha": "387ac29b308b003ca37ba93a6cab5eb57c8f5f93",
80
- "version": "v4.0.0"
94
+ "sha": "8df1039502a15bceb9433410b1a100fbe190c53b",
95
+ "version": "v4.5.0"
81
96
  },
82
97
  "actions/setup-node": {
83
98
  "name": "actions/setup-node",
84
- "sha": "b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8",
85
- "version": "v4.0.1"
99
+ "sha": "39370e3970a6d050c480ffad4ff0ed4d3fdee5af",
100
+ "version": "v4.1.0"
86
101
  },
87
102
  "actions/setup-python": {
88
103
  "name": "actions/setup-python",
89
- "sha": "0a5c61591373683505ea898e09a3ea4f39ef2b9c",
90
- "version": "v5.0.0"
104
+ "sha": "0b93645e9fea7318ecaed2b359559ac225c90a2b",
105
+ "version": "v5.3.0"
91
106
  },
92
107
  "actions/stale": {
93
108
  "name": "actions/stale",
@@ -96,18 +111,33 @@
96
111
  },
97
112
  "actions/upload-artifact": {
98
113
  "name": "actions/upload-artifact",
99
- "sha": "c7d193f32edcb7bfad88892161225aeda64e9392",
100
- "version": "v4.0.0"
114
+ "sha": "b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882",
115
+ "version": "v4.4.3"
116
+ },
117
+ "actions/upload-pages-artifact": {
118
+ "name": "actions/upload-pages-artifact",
119
+ "sha": "56afc609e74202658d3ffba0e8f6dda462b719fa",
120
+ "version": "v3.0.1"
121
+ },
122
+ "anchore/scan-action": {
123
+ "name": "anchore/scan-action",
124
+ "sha": "869c549e657a088dc0441b08ce4fc0ecdac2bb65",
125
+ "version": "v5.3.0"
101
126
  },
102
127
  "android-actions/setup-android": {
103
128
  "name": "android-actions/setup-android",
104
- "sha": "07976c6290703d34c16d382cb36445f98bb43b1f",
105
- "version": "v3.2.0"
129
+ "sha": "9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407",
130
+ "version": "v3.2.2"
131
+ },
132
+ "andymckay/labeler": {
133
+ "name": "andymckay/labeler",
134
+ "sha": "e6c4322d0397f3240f0e7e30a33b5c5df2d39e90",
135
+ "version": "1.0.4"
106
136
  },
107
137
  "azure/webapps-deploy": {
108
138
  "name": "azure/webapps-deploy",
109
- "sha": "145a0687697df1d8a28909569f6e5d86213041f9",
110
- "version": "v3.0.0"
139
+ "sha": "de617f46172a906d0617bb0e50d81e9e3aec24c8",
140
+ "version": "v3.0.1"
111
141
  },
112
142
  "bitwarden/sm-action": {
113
143
  "name": "bitwarden/sm-action",
@@ -116,22 +146,22 @@
116
146
  },
117
147
  "checkmarx/ast-github-action": {
118
148
  "name": "checkmarx/ast-github-action",
119
- "sha": "72d549beebd0bc5bbafa559f198161b6ce7c03df",
120
- "version": "2.0.21"
149
+ "sha": "b74e8d514feae4ad5ad2b43e72590935bd2daf5f",
150
+ "version": "2.0.39"
121
151
  },
122
152
  "chrnorm/deployment-action": {
123
153
  "name": "chrnorm/deployment-action",
124
- "sha": "d42cde7132fcec920de534fffc3be83794335c00",
125
- "version": "v2.0.5"
154
+ "sha": "55729fcebec3d284f60f5bcabbd8376437d696b1",
155
+ "version": "v2.0.7"
126
156
  },
127
157
  "chrnorm/deployment-status": {
128
158
  "name": "chrnorm/deployment-status",
129
- "sha": "2afb7d27101260f4a764219439564d954d10b5b0",
130
- "version": "v2.0.1"
159
+ "sha": "9a72af4586197112e0491ea843682b5dc280d806",
160
+ "version": "v2.0.3"
131
161
  },
132
162
  "chromaui/action": {
133
163
  "name": "chromaui/action",
134
- "sha": "80bf5911f28005ed208f15b7268843b79ca0e23a",
164
+ "sha": "e90c5a5e3bc2eb3b8e110d606f56a0f44fa47700",
135
165
  "version": "v1"
136
166
  },
137
167
  "cloudflare/pages-action": {
@@ -139,6 +169,16 @@
139
169
  "sha": "f0a1cd58cd66095dee69bfa18fa5efd1dde93bca",
140
170
  "version": "v1.5.0"
141
171
  },
172
+ "codecov/codecov-action": {
173
+ "name": "codecov/codecov-action",
174
+ "sha": "7f8b4b4bde536c465e797be725718b88c5d95e0e",
175
+ "version": "v5.1.1"
176
+ },
177
+ "codecov/test-results-action": {
178
+ "name": "codecov/test-results-action",
179
+ "sha": "9739113ad922ea0a9abb4b2c0f8bf6a4aa8ef820",
180
+ "version": "v1.0.1"
181
+ },
142
182
  "convictional/trigger-workflow-and-wait": {
143
183
  "name": "convictional/trigger-workflow-and-wait",
144
184
  "sha": "f69fa9eedd3c62a599220f4d5745230e237904be",
@@ -146,48 +186,48 @@
146
186
  },
147
187
  "crazy-max/ghaction-import-gpg": {
148
188
  "name": "crazy-max/ghaction-import-gpg",
149
- "sha": "01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4",
150
- "version": "v6.1.0"
189
+ "sha": "cb9bde2e2525e640591a934b1fd28eef1dcaf5e5",
190
+ "version": "v6.2.0"
151
191
  },
152
192
  "crowdin/github-action": {
153
193
  "name": "crowdin/github-action",
154
- "sha": "fdc55cdc519e86e32c22a07528d649277f1127f2",
155
- "version": "v1.16.0"
194
+ "sha": "a9ffb7d5ac46eca1bb1f06656bf888b39462f161",
195
+ "version": "v2.4.0"
156
196
  },
157
197
  "dawidd6/action-download-artifact": {
158
198
  "name": "dawidd6/action-download-artifact",
159
- "sha": "e7466d1a7587ed14867642c2ca74b5bcc1e19a2d",
160
- "version": "v3.0.0"
199
+ "sha": "80620a5d27ce0ae443b965134db88467fc607b43",
200
+ "version": "v7"
161
201
  },
162
202
  "dawidd6/action-homebrew-bump-formula": {
163
203
  "name": "dawidd6/action-homebrew-bump-formula",
164
- "sha": "75ed025ff3ad1d617862838b342b06d613a0ddf3",
165
- "version": "v3.10.1"
204
+ "sha": "8d494330bce4434918392df134ad3db1167904db",
205
+ "version": "v4"
166
206
  },
167
207
  "digitalocean/action-doctl": {
168
208
  "name": "digitalocean/action-doctl",
169
- "sha": "e5cb5b0cde9789f79c5115c2c4d902f38a708804",
170
- "version": "v2.5.0"
209
+ "sha": "135ac0aa0eed4437d547c6f12c364d3006b42824",
210
+ "version": "v2.5.1"
171
211
  },
172
212
  "docker/build-push-action": {
173
213
  "name": "docker/build-push-action",
174
- "sha": "4a13e500e55cf31b7a5d59a38ab2040ab0f42f56",
175
- "version": "v5.1.0"
214
+ "sha": "48aba3b46d1b1fec4febb7c5d0c644b249a11355",
215
+ "version": "v6.10.0"
176
216
  },
177
217
  "docker/setup-buildx-action": {
178
218
  "name": "docker/setup-buildx-action",
179
- "sha": "f95db51fddba0c2d1ec667646a06c2ce06100226",
180
- "version": "v3.0.0"
219
+ "sha": "c47758b77c9736f4b2ef4073d4d51994fabfe349",
220
+ "version": "v3.7.1"
181
221
  },
182
222
  "docker/setup-qemu-action": {
183
223
  "name": "docker/setup-qemu-action",
184
- "sha": "68827325e0b33c7199eb31dd4e31fbe9023e06e3",
185
- "version": "v3.0.0"
224
+ "sha": "49b3bc8e6bdd4a60e6116a5414239cba5943d3cf",
225
+ "version": "v3.2.0"
186
226
  },
187
227
  "dorny/test-reporter": {
188
228
  "name": "dorny/test-reporter",
189
- "sha": "afe6793191b75b608954023a46831a3fe10048d4",
190
- "version": "v1.7.0"
229
+ "sha": "31a54ee7ebcacc03a09ea97a7e5465a47b84aea5",
230
+ "version": "v1.9.1"
191
231
  },
192
232
  "dtolnay/rust-toolchain": {
193
233
  "name": "dtolnay/rust-toolchain",
@@ -196,63 +236,118 @@
196
236
  },
197
237
  "futureware-tech/simulator-action": {
198
238
  "name": "futureware-tech/simulator-action",
199
- "sha": "bfa03d93ec9de6dacb0c5553bbf8da8afc6c2ee9",
200
- "version": "v3"
239
+ "sha": "dab10d813144ef59b48d401cd95da151222ef8cd",
240
+ "version": "v4"
241
+ },
242
+ "github/codeql-action": {
243
+ "name": "github/codeql-action",
244
+ "sha": "3096afedf9873361b2b2f65e1445b13272c83eb8",
245
+ "version": "codeql-bundle-v2.20.0"
246
+ },
247
+ "gradle/actions": {
248
+ "name": "gradle/actions",
249
+ "sha": "cc4fc85e6b35bafd578d5ffbc76a5518407e1af0",
250
+ "version": "v4.2.1"
201
251
  },
202
252
  "hashicorp/setup-packer": {
203
253
  "name": "hashicorp/setup-packer",
204
- "sha": "ecc5516821087666a672c0d280a0084ea6d9aafd",
205
- "version": "v2.0.1"
254
+ "sha": "1aa358be5cf73883762b302a3a03abd66e75b232",
255
+ "version": "v3.1.0"
256
+ },
257
+ "helm/chart-releaser-action": {
258
+ "name": "helm/chart-releaser-action",
259
+ "sha": "a917fd15b20e8b64b94d9158ad54cd6345335584",
260
+ "version": "v1.6.0"
261
+ },
262
+ "helm/chart-testing-action": {
263
+ "name": "helm/chart-testing-action",
264
+ "sha": "e6669bcd63d7cb57cb4380c33043eebe5d111992",
265
+ "version": "v2.6.1"
266
+ },
267
+ "helm/kind-action": {
268
+ "name": "helm/kind-action",
269
+ "sha": "0025e74a8c7512023d06dc019c617aa3cf561fde",
270
+ "version": "v1.10.0"
271
+ },
272
+ "launchdarkly/find-code-references-in-pull-request": {
273
+ "name": "launchdarkly/find-code-references-in-pull-request",
274
+ "sha": "d008aa4f321d8cd35314d9cb095388dcfde84439",
275
+ "version": "v2.0.0"
206
276
  },
207
277
  "macauley/action-homebrew-bump-cask": {
208
278
  "name": "macauley/action-homebrew-bump-cask",
209
279
  "sha": "445c42390d790569d938f9068d01af39ca030feb",
210
280
  "version": "v1.0.0"
211
281
  },
282
+ "maxim-lobanov/setup-xcode": {
283
+ "name": "maxim-lobanov/setup-xcode",
284
+ "sha": "60606e260d2fc5762a71e64e74b2174e8ea3c8bd",
285
+ "version": "v1.6.0"
286
+ },
212
287
  "microsoft/setup-msbuild": {
213
288
  "name": "microsoft/setup-msbuild",
214
- "sha": "1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c",
215
- "version": "v1.3.1"
289
+ "sha": "6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce",
290
+ "version": "v2"
216
291
  },
217
292
  "ncipollo/release-action": {
218
293
  "name": "ncipollo/release-action",
219
- "sha": "6c75be85e571768fa31b40abf38de58ba0397db5",
220
- "version": "v1.13.0"
294
+ "sha": "2c591bcc8ecdcd2db72b97d6147f871fcd833ba5",
295
+ "version": "v1.14.0"
221
296
  },
222
297
  "peter-evans/close-issue": {
223
298
  "name": "peter-evans/close-issue",
224
299
  "sha": "276d7966e389d888f011539a86c8920025ea0626",
225
300
  "version": "v3.0.1"
226
301
  },
302
+ "reactivecircus/android-emulator-runner": {
303
+ "name": "reactivecircus/android-emulator-runner",
304
+ "sha": "62dbb605bba737720e10b196cb4220d374026a6d",
305
+ "version": "v2.33.0"
306
+ },
227
307
  "ruby/setup-ruby": {
228
308
  "name": "ruby/setup-ruby",
229
- "sha": "360dc864d5da99d54fcb8e9148c14a84b90d3e88",
230
- "version": "v1.165.1"
309
+ "sha": "2a18b06812b0e15bb916e1df298d3e740422c47e",
310
+ "version": "v1.203.0"
231
311
  },
232
312
  "samuelmeuli/action-snapcraft": {
233
313
  "name": "samuelmeuli/action-snapcraft",
234
314
  "sha": "d33c176a9b784876d966f80fb1b461808edc0641",
235
315
  "version": "v2.1.1"
236
316
  },
317
+ "slackapi/slack-github-action": {
318
+ "name": "slackapi/slack-github-action",
319
+ "sha": "485a9d42d3a73031f12ec201c457e2162c45d02d",
320
+ "version": "v2.0.0"
321
+ },
237
322
  "snapcore/action-build": {
238
323
  "name": "snapcore/action-build",
239
- "sha": "2096990827aa966f773676c8a53793c723b6b40f",
240
- "version": "v1.2.0"
324
+ "sha": "3bdaa03e1ba6bf59a65f84a751d943d549a54e79",
325
+ "version": "v1.3.0"
326
+ },
327
+ "softprops/action-gh-release": {
328
+ "name": "softprops/action-gh-release",
329
+ "sha": "7b4da11513bf3f43f9999e90eabced41ab8bb048",
330
+ "version": "v2.2.0"
241
331
  },
242
332
  "sonarsource/sonarcloud-github-action": {
243
333
  "name": "sonarsource/sonarcloud-github-action",
244
- "sha": "49e6cd3b187936a73b8280d59ffd9da69df63ec9",
245
- "version": "v2.1.1"
334
+ "sha": "02ef91109b2d589e757aefcfb2854c2783fd7b19",
335
+ "version": "v4.0.0"
246
336
  },
247
337
  "stackrox/kube-linter-action": {
248
338
  "name": "stackrox/kube-linter-action",
249
- "sha": "ca0d55b925470deb5b04b556e6c4276ea94d03c3",
250
- "version": "v1.0.4"
339
+ "sha": "5792edc6a03735d592b13c08201711327a935735",
340
+ "version": "v1.0.5"
251
341
  },
252
342
  "tj-actions/changed-files": {
253
343
  "name": "tj-actions/changed-files",
254
- "sha": "716b1e13042866565e00e85fd4ec490e186c4a2f",
255
- "version": "v41.0.1"
344
+ "sha": "bab30c2299617f6615ec02a68b9a40d10bd21366",
345
+ "version": "v45.0.5"
346
+ },
347
+ "tyrrrz/action-http-request": {
348
+ "name": "tyrrrz/action-http-request",
349
+ "sha": "64c70c67f5ebc54d4c7ea09cbe3553322778afd5",
350
+ "version": "1.1.2"
256
351
  },
257
352
  "yogevbd/enforce-label-action": {
258
353
  "name": "yogevbd/enforce-label-action",
@@ -3,7 +3,7 @@ enabled_rules:
3
3
  - bitwarden_workflow_linter.rules.name_capitalized.RuleNameCapitalized
4
4
  - bitwarden_workflow_linter.rules.pinned_job_runner.RuleJobRunnerVersionPinned
5
5
  - bitwarden_workflow_linter.rules.job_environment_prefix.RuleJobEnvironmentPrefix
6
- - bitwarden_workflow_linter.rules.step_pinned.RuleStepUsesPinned
6
+ - bitwarden_workflow_linter.rules.step_approved.RuleStepUsesApproved
7
7
  - bitwarden_workflow_linter.rules.step_pinned.RuleStepUsesPinned
8
8
  - bitwarden_workflow_linter.rules.underscore_outputs.RuleUnderscoreOutputs
9
9
 
@@ -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
- # Actions in bitwarden/gh-actions are auto-approved
86
- if obj.uses and not obj.uses_path in self.settings.approved_actions:
87
- return False, (
88
- f"New Action detected: {obj.uses_path}\nFor security purposes, "
89
- "actions must be reviewed and be on the pre-approved list"
90
- )
85
+ obj_path = obj.uses_path
91
86
 
92
- action = self.settings.approved_actions[obj.uses_path]
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])
93
90
 
94
- if obj.uses_version != action.version or obj.uses_ref != action.sha:
91
+ # Actions in bitwarden/ are auto-approved
92
+ if obj.uses and not obj_path in self.settings.approved_actions:
95
93
  return False, (
96
- "Action is out of date. Please update to:\n"
97
- f" commit: {action.version}"
98
- f" version: {action.sha}"
94
+ f"New Action detected: {obj.uses_path}\nFor security purposes, "
95
+ "actions must be reviewed and be on the pre-approved list"
99
96
  )
100
97
 
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.2.1
3
+ Version: 0.3.1
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,9 +1,9 @@
1
- bitwarden_workflow_linter/__about__.py,sha256=i7sjN4kIit1ye9XdGItqGi91cWiWv11IUmljOfGbykA,59
1
+ bitwarden_workflow_linter/__about__.py,sha256=_27O6iZ8VbPFHvbz_YLPvVgFxHFgl7gH0MtXCkHXols,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=BeFllnAu9v6cX6eeGeNoQf3rXs7ZOjAtjTNBQuAZ8-k,8087
6
- bitwarden_workflow_linter/default_settings.yaml,sha256=lgIKpirGuxRa06QCOxalPP9H-aObYhXFryrHkEKQNM0,572
5
+ bitwarden_workflow_linter/default_actions.json,sha256=WU6olaa9ldyWRXDmVz8wtBcgE28BSjJc7Evt26GkFPY,11120
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
9
9
  bitwarden_workflow_linter/rule.py,sha256=Qb60JiUDAWN3ayrMGoSbbDCSFmw-ql8djzAkxISaob4,3250
@@ -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=xZE9x40P-C4SqOxjYN3ZHR4gxWSkYJFEfYwEzA2c05w,3287
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.2.1.dist-info/METADATA,sha256=-2gvyfTfmDQrjtDMT1kwxuISDAvoikpJkXj611PdvSI,6146
24
- bitwarden_workflow_linter-0.2.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
25
- bitwarden_workflow_linter-0.2.1.dist-info/entry_points.txt,sha256=SA_yF9CwL4VMUvdcmCd7k9rjsQNzfeOUBuDnMnaO8QQ,60
26
- bitwarden_workflow_linter-0.2.1.dist-info/licenses/LICENSE.txt,sha256=uY-7N9tbI7xc_c0WeTIGpacSCnsB91N05eCIg3bkaRw,35140
27
- bitwarden_workflow_linter-0.2.1.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.3.1.dist-info/METADATA,sha256=s7fNYZYIIfVgouZwoRFwAlxSlokQ18vqcaCZ5YGl6_s,6172
24
+ bitwarden_workflow_linter-0.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
25
+ bitwarden_workflow_linter-0.3.1.dist-info/entry_points.txt,sha256=SA_yF9CwL4VMUvdcmCd7k9rjsQNzfeOUBuDnMnaO8QQ,60
26
+ bitwarden_workflow_linter-0.3.1.dist-info/licenses/LICENSE.txt,sha256=uY-7N9tbI7xc_c0WeTIGpacSCnsB91N05eCIg3bkaRw,35140
27
+ bitwarden_workflow_linter-0.3.1.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