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.
- bitwarden_workflow_linter/__about__.py +1 -1
- bitwarden_workflow_linter/actions.py +44 -20
- bitwarden_workflow_linter/default_actions.json +168 -73
- bitwarden_workflow_linter/default_settings.yaml +1 -1
- bitwarden_workflow_linter/rules/job_environment_prefix.py +8 -2
- bitwarden_workflow_linter/rules/name_capitalized.py +2 -1
- bitwarden_workflow_linter/rules/step_approved.py +9 -12
- bitwarden_workflow_linter/rules/step_pinned.py +1 -1
- bitwarden_workflow_linter/rules/underscore_outputs.py +1 -9
- {bitwarden_workflow_linter-0.2.1.dist-info → bitwarden_workflow_linter-0.3.1.dist-info}/METADATA +3 -2
- {bitwarden_workflow_linter-0.2.1.dist-info → bitwarden_workflow_linter-0.3.1.dist-info}/RECORD +14 -14
- {bitwarden_workflow_linter-0.2.1.dist-info → bitwarden_workflow_linter-0.3.1.dist-info}/WHEEL +1 -1
- {bitwarden_workflow_linter-0.2.1.dist-info → bitwarden_workflow_linter-0.3.1.dist-info}/entry_points.txt +0 -0
- {bitwarden_workflow_linter-0.2.1.dist-info → bitwarden_workflow_linter-0.3.1.dist-info}/licenses/LICENSE.txt +0 -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(
|
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
|
-
|
135
|
+
if response is not None and response.status != 404:
|
136
|
+
tag_name = json.loads(response.data)["tag_name"]
|
132
137
|
|
133
|
-
|
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
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
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
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
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)["
|
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": "
|
10
|
-
"version": "v1.5.
|
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": "
|
20
|
-
"version": "
|
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": "
|
25
|
-
"version": "v2.7.
|
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": "
|
40
|
-
"version": "v2.
|
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": "
|
45
|
-
"version": "
|
54
|
+
"sha": "1bd1e32a3bdc45362d1e726936510720a7c30a57",
|
55
|
+
"version": "v4.2.0"
|
46
56
|
},
|
47
57
|
"actions/checkout": {
|
48
58
|
"name": "actions/checkout",
|
49
|
-
"sha": "
|
50
|
-
"version": "v4.
|
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": "
|
55
|
-
"version": "
|
69
|
+
"sha": "e5bc658cc4c965c472efe991f8beea3981499c55",
|
70
|
+
"version": "v5.0.0"
|
56
71
|
},
|
57
72
|
"actions/download-artifact": {
|
58
73
|
"name": "actions/download-artifact",
|
59
|
-
"sha": "
|
60
|
-
"version": "v4.1.
|
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": "
|
75
|
-
"version": "v4.
|
89
|
+
"sha": "3e891b0cb619bf60e2c25674b222b8940e2c1c25",
|
90
|
+
"version": "v4.1.0"
|
76
91
|
},
|
77
92
|
"actions/setup-java": {
|
78
93
|
"name": "actions/setup-java",
|
79
|
-
"sha": "
|
80
|
-
"version": "v4.
|
94
|
+
"sha": "8df1039502a15bceb9433410b1a100fbe190c53b",
|
95
|
+
"version": "v4.5.0"
|
81
96
|
},
|
82
97
|
"actions/setup-node": {
|
83
98
|
"name": "actions/setup-node",
|
84
|
-
"sha": "
|
85
|
-
"version": "v4.0
|
99
|
+
"sha": "39370e3970a6d050c480ffad4ff0ed4d3fdee5af",
|
100
|
+
"version": "v4.1.0"
|
86
101
|
},
|
87
102
|
"actions/setup-python": {
|
88
103
|
"name": "actions/setup-python",
|
89
|
-
"sha": "
|
90
|
-
"version": "v5.
|
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": "
|
100
|
-
"version": "v4.
|
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": "
|
105
|
-
"version": "v3.2.
|
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": "
|
110
|
-
"version": "v3.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": "
|
120
|
-
"version": "2.0.
|
149
|
+
"sha": "b74e8d514feae4ad5ad2b43e72590935bd2daf5f",
|
150
|
+
"version": "2.0.39"
|
121
151
|
},
|
122
152
|
"chrnorm/deployment-action": {
|
123
153
|
"name": "chrnorm/deployment-action",
|
124
|
-
"sha": "
|
125
|
-
"version": "v2.0.
|
154
|
+
"sha": "55729fcebec3d284f60f5bcabbd8376437d696b1",
|
155
|
+
"version": "v2.0.7"
|
126
156
|
},
|
127
157
|
"chrnorm/deployment-status": {
|
128
158
|
"name": "chrnorm/deployment-status",
|
129
|
-
"sha": "
|
130
|
-
"version": "v2.0.
|
159
|
+
"sha": "9a72af4586197112e0491ea843682b5dc280d806",
|
160
|
+
"version": "v2.0.3"
|
131
161
|
},
|
132
162
|
"chromaui/action": {
|
133
163
|
"name": "chromaui/action",
|
134
|
-
"sha": "
|
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": "
|
150
|
-
"version": "v6.
|
189
|
+
"sha": "cb9bde2e2525e640591a934b1fd28eef1dcaf5e5",
|
190
|
+
"version": "v6.2.0"
|
151
191
|
},
|
152
192
|
"crowdin/github-action": {
|
153
193
|
"name": "crowdin/github-action",
|
154
|
-
"sha": "
|
155
|
-
"version": "
|
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": "
|
160
|
-
"version": "
|
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": "
|
165
|
-
"version": "
|
204
|
+
"sha": "8d494330bce4434918392df134ad3db1167904db",
|
205
|
+
"version": "v4"
|
166
206
|
},
|
167
207
|
"digitalocean/action-doctl": {
|
168
208
|
"name": "digitalocean/action-doctl",
|
169
|
-
"sha": "
|
170
|
-
"version": "v2.5.
|
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": "
|
175
|
-
"version": "
|
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": "
|
180
|
-
"version": "v3.
|
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": "
|
185
|
-
"version": "v3.
|
224
|
+
"sha": "49b3bc8e6bdd4a60e6116a5414239cba5943d3cf",
|
225
|
+
"version": "v3.2.0"
|
186
226
|
},
|
187
227
|
"dorny/test-reporter": {
|
188
228
|
"name": "dorny/test-reporter",
|
189
|
-
"sha": "
|
190
|
-
"version": "v1.
|
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": "
|
200
|
-
"version": "
|
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": "
|
205
|
-
"version": "
|
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": "
|
215
|
-
"version": "
|
289
|
+
"sha": "6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce",
|
290
|
+
"version": "v2"
|
216
291
|
},
|
217
292
|
"ncipollo/release-action": {
|
218
293
|
"name": "ncipollo/release-action",
|
219
|
-
"sha": "
|
220
|
-
"version": "v1.
|
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": "
|
230
|
-
"version": "v1.
|
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": "
|
240
|
-
"version": "v1.
|
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": "
|
245
|
-
"version": "
|
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": "
|
250
|
-
"version": "v1.0.
|
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": "
|
255
|
-
"version": "
|
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.
|
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 = {
|
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} ({'
|
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.
|
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
|
-
|
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
|
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
|
-
|
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
|
97
|
-
|
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, ""
|
@@ -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}: ({'
|
119
|
+
f"{obj.__class__.__name__} {self.message}: ({', '.join(offending_keys)})",
|
128
120
|
)
|
{bitwarden_workflow_linter-0.2.1.dist-info → bitwarden_workflow_linter-0.3.1.dist-info}/METADATA
RENAMED
@@ -1,9 +1,10 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: bitwarden_workflow_linter
|
3
|
-
Version: 0.
|
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
|
{bitwarden_workflow_linter-0.2.1.dist-info → bitwarden_workflow_linter-0.3.1.dist-info}/RECORD
RENAMED
@@ -1,9 +1,9 @@
|
|
1
|
-
bitwarden_workflow_linter/__about__.py,sha256=
|
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=
|
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=
|
6
|
-
bitwarden_workflow_linter/default_settings.yaml,sha256=
|
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=
|
17
|
-
bitwarden_workflow_linter/rules/name_capitalized.py,sha256=
|
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=
|
21
|
-
bitwarden_workflow_linter/rules/step_pinned.py,sha256=
|
22
|
-
bitwarden_workflow_linter/rules/underscore_outputs.py,sha256=
|
23
|
-
bitwarden_workflow_linter-0.
|
24
|
-
bitwarden_workflow_linter-0.
|
25
|
-
bitwarden_workflow_linter-0.
|
26
|
-
bitwarden_workflow_linter-0.
|
27
|
-
bitwarden_workflow_linter-0.
|
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,,
|
File without changes
|
File without changes
|