|
60 | 60 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json
|
61 | 61 | WORKFLOW_SCHEMA_URL: https://json.schemastore.org/github-workflow
|
62 | 62 | WORKFLOW_SCHEMA_PATH:
|
63 |
| - sh: mktemp -t workflow-schema-XXXXXXXXXX.json |
| 63 | + sh: task utility:mktemp-file TEMPLATE="workflow-schema-XXXXXXXXXX.json" |
64 | 64 | WORKFLOWS_DATA_PATH: "./.github/workflows/*.{yml,yaml}"
|
65 | 65 | TEMPLATE_WORKFLOWS_DATA_PATH: "./workflow-templates/*.{yml,yaml}"
|
66 | 66 | deps:
|
@@ -115,7 +115,7 @@ tasks:
|
115 | 115 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/dependabot-2.0.json
|
116 | 116 | SCHEMA_URL: https://json.schemastore.org/dependabot-2.0
|
117 | 117 | SCHEMA_PATH:
|
118 |
| - sh: mktemp -t dependabot-schema-XXXXXXXXXX.json |
| 118 | + sh: task utility:mktemp-file TEMPLATE="dependabot-schema-XXXXXXXXXX.json" |
119 | 119 | DATA_PATH: "**/dependabot.yml"
|
120 | 120 | cmds:
|
121 | 121 | - wget --quiet --output-document="{{.SCHEMA_PATH}}" {{.SCHEMA_URL}}
|
@@ -199,7 +199,7 @@ tasks:
|
199 | 199 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-issue-forms.json
|
200 | 200 | SCHEMA_URL: https://json.schemastore.org/github-issue-forms.json
|
201 | 201 | SCHEMA_PATH:
|
202 |
| - sh: mktemp -t github-issue-forms-schema-XXXXXXXXXX.json |
| 202 | + sh: task utility:mktemp-file TEMPLATE="github-issue-forms-schema-XXXXXXXXXX.json" |
203 | 203 | DATA_PATH: "issue-templates/forms/**/*.{yml,yaml}"
|
204 | 204 | deps:
|
205 | 205 | - task: npm:install-deps
|
@@ -314,7 +314,7 @@ tasks:
|
314 | 314 | # Source: https://github.com/DavidAnson/markdownlint/blob/main/schema/markdownlint-config-schema.json
|
315 | 315 | SCHEMA_URL: https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json
|
316 | 316 | SCHEMA_PATH:
|
317 |
| - sh: mktemp -t markdownlint-schema-XXXXXXXXXX.json |
| 317 | + sh: task utility:mktemp-file TEMPLATE="markdownlint-schema-XXXXXXXXXX.json" |
318 | 318 | DATA_PATH: "**/.markdownlint.{yml,yaml}"
|
319 | 319 | deps:
|
320 | 320 | - task: npm:install-deps
|
@@ -347,31 +347,31 @@ tasks:
|
347 | 347 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/package.json
|
348 | 348 | SCHEMA_URL: https://json.schemastore.org/package.json
|
349 | 349 | SCHEMA_PATH:
|
350 |
| - sh: mktemp -t package-json-schema-XXXXXXXXXX.json |
| 350 | + sh: task utility:mktemp-file TEMPLATE="package-json-schema-XXXXXXXXXX.json" |
351 | 351 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/ava.json
|
352 | 352 | AVA_SCHEMA_URL: https://json.schemastore.org/ava.json
|
353 | 353 | AVA_SCHEMA_PATH:
|
354 |
| - sh: mktemp -t ava-schema-XXXXXXXXXX.json |
| 354 | + sh: task utility:mktemp-file TEMPLATE="ava-schema-XXXXXXXXXX.json" |
355 | 355 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/eslintrc.json
|
356 | 356 | ESLINTRC_SCHEMA_URL: https://json.schemastore.org/eslintrc.json
|
357 | 357 | ESLINTRC_SCHEMA_PATH:
|
358 |
| - sh: mktemp -t eslintrc-schema-XXXXXXXXXX.json |
| 358 | + sh: task utility:mktemp-file TEMPLATE="eslintrc-schema-XXXXXXXXXX.json" |
359 | 359 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/jscpd.json
|
360 | 360 | JSCPD_SCHEMA_URL: https://json.schemastore.org/jscpd.json
|
361 | 361 | JSCPD_SCHEMA_PATH:
|
362 |
| - sh: mktemp -t jscpd-schema-XXXXXXXXXX.json |
| 362 | + sh: task utility:mktemp-file TEMPLATE="jscpd-schema-XXXXXXXXXX.json" |
363 | 363 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/prettierrc.json
|
364 | 364 | PRETTIERRC_SCHEMA_URL: https://json.schemastore.org/prettierrc.json
|
365 | 365 | PRETTIERRC_SCHEMA_PATH:
|
366 |
| - sh: mktemp -t prettierrc-schema-XXXXXXXXXX.json |
| 366 | + sh: task utility:mktemp-file TEMPLATE="prettierrc-schema-XXXXXXXXXX.json" |
367 | 367 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/semantic-release.json
|
368 | 368 | SEMANTIC_RELEASE_SCHEMA_URL: https://json.schemastore.org/semantic-release.json
|
369 | 369 | SEMANTIC_RELEASE_SCHEMA_PATH:
|
370 |
| - sh: mktemp -t semantic-release-schema-XXXXXXXXXX.json |
| 370 | + sh: task utility:mktemp-file TEMPLATE="semantic-release-schema-XXXXXXXXXX.json" |
371 | 371 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/stylelintrc.json
|
372 | 372 | STYLELINTRC_SCHEMA_URL: https://json.schemastore.org/stylelintrc.json
|
373 | 373 | STYLELINTRC_SCHEMA_PATH:
|
374 |
| - sh: mktemp -t stylelintrc-schema-XXXXXXXXXX.json |
| 374 | + sh: task utility:mktemp-file TEMPLATE="stylelintrc-schema-XXXXXXXXXX.json" |
375 | 375 | INSTANCE_PATH: "**/package.json"
|
376 | 376 | cmds:
|
377 | 377 | - wget --quiet --output-document="{{.SCHEMA_PATH}}" {{.SCHEMA_URL}}
|
@@ -503,6 +503,30 @@ tasks:
|
503 | 503 | fi
|
504 | 504 | - shfmt -w .
|
505 | 505 |
|
| 506 | + # Make a temporary file named according to the passed TEMPLATE variable and print the path passed to stdout |
| 507 | + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml |
| 508 | + utility:mktemp-file: |
| 509 | + vars: |
| 510 | + RAW_PATH: |
| 511 | + sh: mktemp --tmpdir "{{.TEMPLATE}}" |
| 512 | + cmds: |
| 513 | + - task: utility:normalize-path |
| 514 | + vars: |
| 515 | + RAW_PATH: "{{.RAW_PATH}}" |
| 516 | + |
| 517 | + # Print a normalized version of the path passed via the RAW_PATH variable to stdout |
| 518 | + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml |
| 519 | + utility:normalize-path: |
| 520 | + cmds: |
| 521 | + - | |
| 522 | + if [[ "{{.OS}}" == "Windows_NT" ]] && which cygpath &>/dev/null; then |
| 523 | + # Even though the shell handles POSIX format absolute paths as expected, external applications do not. |
| 524 | + # So paths passed to such applications must first be converted to Windows format. |
| 525 | + cygpath -w "{{.RAW_PATH}}" |
| 526 | + else |
| 527 | + echo "{{.RAW_PATH}}" |
| 528 | + fi |
| 529 | +
|
506 | 530 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml-task/Taskfile.yml
|
507 | 531 | yaml:lint:
|
508 | 532 | desc: Check for problems with YAML files
|
|
0 commit comments