-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathTaskfile.yml
42 lines (38 loc) · 1.6 KB
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
version: "3"
tasks:
fix:
desc: Make automated corrections to the project's files
deps:
- task: dependabot:sync
check:
desc: Check for problems with the project
deps:
- task: config:validate
dependabot:sync:
desc: Sync workflow duplicates for dependabot checks
vars:
WORKFLOW_TEMPLATES_PATH: "./workflow-templates"
WORKFLOW_TEMPLATE_COPIES_PATH: "./workflow-templates/dependabot/workflow-template-copies/.github/workflows"
cmds:
# Sync workflow templates with the copies in the folder where Dependabot can check them for updates.
- mkdir --parents "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}"
- rm --force "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}"/*
- |
find "{{.WORKFLOW_TEMPLATES_PATH}}" \
-maxdepth 1 \
-type f \
-regex '.*\.ya?ml' \
-exec cp '{}' "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}" \;
config:validate:
desc: Validate configuration files against their JSON schema
vars:
# Last version with support for draft-04, used by Dependabot schema
AJV_CLI_VERSION: 3.3.0
# Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/dependabot-2.0.json
DEPENDABOT_SCHEMA_URL: https://json.schemastore.org/dependabot-2.0
DEPENDABOT_SCHEMA_PATH:
sh: mktemp -t dependabot-schema-XXXXXXXXXX.json
DEPENDABOT_DATA_PATH: "**/dependabot.yml"
cmds:
- wget --quiet --output-document="{{.DEPENDABOT_SCHEMA_PATH}}" {{.DEPENDABOT_SCHEMA_URL}}
- npx ajv-cli@{{.AJV_CLI_VERSION}} validate -s "{{.DEPENDABOT_SCHEMA_PATH}}" -d "{{.DEPENDABOT_DATA_PATH}}"