Skip to content

Commit e9f4d8b

Browse files
committed
Expand usage of variables in workflows:validate task
This facilitates the addition of a comment indicating the repository location of the schema file in case an error is discovered. As for the `WORKFLOWS_DATA_PATH` variable, I'm not sure why I did that (this is being imported from the template workflow which was developed as an independent project 6 months ago).
1 parent 233bbb9 commit e9f4d8b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Taskfile.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,14 @@ tasks:
334334
workflow:validate:
335335
desc: Validate GitHub Actions workflows against JSON schema
336336
vars:
337+
# Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json
338+
WORKFLOW_SCHEMA_URL: https://json.schemastore.org/github-workflow
337339
WORKFLOW_SCHEMA_PATH:
338340
sh: mktemp -t workflow-schema-XXXXXXXXXX.json
341+
WORKFLOWS_DATA_PATH: "./.github/workflows/*.{yml,yaml}"
339342
cmds:
340-
- wget --output-document={{.WORKFLOW_SCHEMA_PATH}} https://json.schemastore.org/github-workflow
341-
- npx ajv-cli validate --strict=false -s {{.WORKFLOW_SCHEMA_PATH}} -d "./.github/workflows/*.{yml,yaml}"
343+
- wget --output-document={{.WORKFLOW_SCHEMA_PATH}} {{.WORKFLOW_SCHEMA_URL}}
344+
- npx ajv-cli validate --strict=false -s {{.WORKFLOW_SCHEMA_PATH}} -d "{{.WORKFLOWS_DATA_PATH}}"
342345

343346
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-general-formatting-task/Taskfile.yml
344347
general:check-formatting:

0 commit comments

Comments
 (0)