Skip to content

Commit 0362e09

Browse files
committed
Reduce unnecessarily broad scope of taskfile var
The `WORKFLOW_SCHEMA_PATH` taskfile variable is only used in the `workflow:validate` task, and is certain to only ever be used there. Declaring it at the global scope only makes the workflow more difficult to understand and maintain.
1 parent f311399 commit 0362e09

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Taskfile.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ tasks:
333333

334334
workflow:validate:
335335
desc: Validate GitHub Actions workflows against JSON schema
336+
vars:
337+
WORKFLOW_SCHEMA_PATH:
338+
sh: mktemp -t workflow-schema-XXXXXXXXXX.json
336339
cmds:
337340
- wget --output-document={{ .WORKFLOW_SCHEMA_PATH }} https://json.schemastore.org/github-workflow
338341
- npx ajv-cli validate --strict=false -s {{ .WORKFLOW_SCHEMA_PATH }} -d "./.github/workflows/*.{yml,yaml}"
@@ -396,7 +399,5 @@ vars:
396399

397400
PRETTIER: prettier@2.1.2
398401

399-
WORKFLOW_SCHEMA_PATH: "$(mktemp -t gha-workflow-schema-XXXXXXXXXX.json)"
400-
401402
CODESPELL_SKIP_OPTION: '--skip "./.git,go.mod,go.sum,./arduino-lint,./arduino-lint.exe,./internal/rule/rulefunction/testdata/libraries/MisspelledSentenceParagraphValue/library.properties,./site"'
402403
CODESPELL_IGNORE_WORDS_OPTION: "--ignore-words ./etc/codespell-ignore-words-list.txt"

0 commit comments

Comments
 (0)