@@ -158,7 +158,6 @@ class GitHubActionConfig implements GitHubActionOverrides {
158158 this .env,
159159 this .continueOnError,
160160 this .timeoutMinutes,
161- this .otherConfig,
162161 }) : assert (
163162 run != null || uses != null ,
164163 'Either `run` or `uses` must be specified' ,
@@ -176,11 +175,8 @@ class GitHubActionConfig implements GitHubActionOverrides {
176175 @override
177176 final String ? uses;
178177
179- /// The command identifier for this step, used in caching.
180- String get command => (run ?? uses)! ;
181-
182178 @override
183- final Map <String , dynamic >? withContent;
179+ final Map <String , String >? withContent;
184180
185181 @override
186182 final String ? ifContent;
@@ -200,9 +196,6 @@ class GitHubActionConfig implements GitHubActionOverrides {
200196 @override
201197 final int ? timeoutMinutes;
202198
203- /// Configuration options not defined by one of the other keys.
204- final Map <String , dynamic >? otherConfig;
205-
206199 factory GitHubActionConfig .fromJson (Map json) {
207200 // Create a copy of unmodifiable `json`.
208201 json = Map .of (json);
@@ -223,7 +216,7 @@ class GitHubActionConfig implements GitHubActionOverrides {
223216 throw CheckedFromJsonException (
224217 json,
225218 'id' ,
226- 'ActionConfig ' ,
219+ 'GitHubActionConfig ' ,
227220 'Invalid `id` parameter. See GitHub docs for more info: '
228221 'https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsid' ,
229222 );
@@ -233,7 +226,7 @@ class GitHubActionConfig implements GitHubActionOverrides {
233226 throw CheckedFromJsonException (
234227 json,
235228 'name' ,
236- 'ActionConfig ' ,
229+ 'GitHubActionConfig ' ,
237230 'Invalid `name` parameter. See GitHub docs for more info: '
238231 'https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsname' ,
239232 );
@@ -243,7 +236,7 @@ class GitHubActionConfig implements GitHubActionOverrides {
243236 throw CheckedFromJsonException (
244237 json,
245238 'run' ,
246- 'ActionConfig ' ,
239+ 'GitHubActionConfig ' ,
247240 'Invalid `run` parameter. See GitHub docs for more info: '
248241 'https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun' ,
249242 );
@@ -253,7 +246,7 @@ class GitHubActionConfig implements GitHubActionOverrides {
253246 throw CheckedFromJsonException (
254247 json,
255248 'uses' ,
256- 'ActionConfig ' ,
249+ 'GitHubActionConfig ' ,
257250 'Invalid `uses` parameter. See GitHub docs for more info: '
258251 'https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses' ,
259252 );
@@ -263,7 +256,7 @@ class GitHubActionConfig implements GitHubActionOverrides {
263256 throw CheckedFromJsonException (
264257 json,
265258 'with' ,
266- 'ActionConfig ' ,
259+ 'GitHubActionConfig ' ,
267260 'Invalid `with` parameter. See GitHub docs for more info: '
268261 'https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith' ,
269262 );
@@ -273,7 +266,7 @@ class GitHubActionConfig implements GitHubActionOverrides {
273266 throw CheckedFromJsonException (
274267 json,
275268 'if' ,
276- 'ActionConfig ' ,
269+ 'GitHubActionConfig ' ,
277270 'Invalid `if` parameter. See GitHub docs for more info: '
278271 'https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsif' ,
279272 );
@@ -283,7 +276,7 @@ class GitHubActionConfig implements GitHubActionOverrides {
283276 throw CheckedFromJsonException (
284277 json,
285278 'working-directory' ,
286- 'ActionConfig ' ,
279+ 'GitHubActionConfig ' ,
287280 'Invalid `working-directory` parameter. See GitHub docs for more info: '
288281 'https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun' ,
289282 );
@@ -293,7 +286,7 @@ class GitHubActionConfig implements GitHubActionOverrides {
293286 throw CheckedFromJsonException (
294287 json,
295288 'shell' ,
296- 'ActionConfig ' ,
289+ 'GitHubActionConfig ' ,
297290 'Invalid `shell` parameter. See GitHub docs for more info: '
298291 'https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell' ,
299292 );
@@ -303,7 +296,7 @@ class GitHubActionConfig implements GitHubActionOverrides {
303296 throw CheckedFromJsonException (
304297 json,
305298 'env' ,
306- 'ActionConfig ' ,
299+ 'GitHubActionConfig ' ,
307300 'Invalid `env` parameter. See GitHub docs for more info: '
308301 'https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsenv' ,
309302 );
@@ -313,7 +306,7 @@ class GitHubActionConfig implements GitHubActionOverrides {
313306 throw CheckedFromJsonException (
314307 json,
315308 'continue-on-error' ,
316- 'ActionConfig ' ,
309+ 'GitHubActionConfig ' ,
317310 'Invalid `continue-on-error` parameter. See GitHub docs for more info: '
318311 'https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error' ,
319312 );
@@ -323,7 +316,7 @@ class GitHubActionConfig implements GitHubActionOverrides {
323316 throw CheckedFromJsonException (
324317 json,
325318 'timeout-minutes' ,
326- 'ActionConfig ' ,
319+ 'GitHubActionConfig ' ,
327320 'Invalid `timeout-minutes` parameter. See GitHub docs for more info: '
328321 'https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepstimeout-minutes' ,
329322 );
@@ -333,23 +326,30 @@ class GitHubActionConfig implements GitHubActionOverrides {
333326 throw CheckedFromJsonException (
334327 json,
335328 'run,uses' ,
336- 'ActionConfig ' ,
329+ 'GitHubActionConfig ' ,
337330 'Either `run` or `uses` must be specified' ,
338331 );
339332 }
333+ if (json.isNotEmpty) {
334+ throw CheckedFromJsonException (
335+ json,
336+ json.keys.join (',' ),
337+ 'GitHubActionConfig' ,
338+ 'Invalid keys' ,
339+ );
340+ }
340341
341342 return GitHubActionConfig (
342343 id: id,
343344 uses: uses,
344345 run: run,
345- withContent: withContent ? . cast ( ),
346+ withContent: toEnvMap (withContent ),
346347 ifContent: ifContent,
347348 workingDirectory: workingDirectory,
348349 shell: shell,
349350 env: toEnvMap (env),
350351 continueOnError: continueOnError,
351352 timeoutMinutes: timeoutMinutes? .toInt (),
352- otherConfig: json.cast (),
353353 );
354354 }
355355}
0 commit comments