|
| 1 | +# https://taskfile.dev |
| 2 | + |
| 3 | +version: '3' |
| 4 | + |
| 5 | +vars: |
| 6 | + GITHUB_ACTIONS_TEMPLATES_HEADER: | |
| 7 | + # Github Actions templates |
| 8 | +
|
| 9 | + This repository contains a number of [GitHub |
| 10 | + Actions](https://docs.github.com/en/actions) workflow template files that |
| 11 | + are copied to a project when running `itkdev-docker-compose |
| 12 | + template:install`. Any changes to the workflows should be made in [this |
| 13 | + repository](%THIS_REPOSITORY%) and then the project template must be updated |
| 14 | + to match the new templates. |
| 15 | +
|
| 16 | + GITHUB_ACTIONS_TEMPLATES_FOOTER: | |
| 17 | +
|
| 18 | +tasks: |
| 19 | + github-actions:documentation:update: |
| 20 | + desc: "Update GitHub Actions template documentation" |
| 21 | + sources: |
| 22 | + - github/workflows/*.yaml |
| 23 | + generates: |
| 24 | + - docs/github-action-templates.md |
| 25 | + cmds: |
| 26 | + - mkdir -p docs |
| 27 | + - | |
| 28 | + echo '{{.GITHUB_ACTIONS_TEMPLATES_HEADER}}' > docs/github-action-templates.md |
| 29 | + - | |
| 30 | + for f in github/workflows/*.yaml; do |
| 31 | + echo "" >> docs/github-action-templates.md |
| 32 | + echo "---" >> docs/github-action-templates.md |
| 33 | + echo "" >> docs/github-action-templates.md |
| 34 | +
|
| 35 | + echo "[$f]($f)" >> docs/github-action-templates.md |
| 36 | +
|
| 37 | + cat "$f" | grep -E '^###( |$)' | sed -E -e 's/^### ?//' >> docs/github-action-templates.md |
| 38 | + done |
| 39 | + - | |
| 40 | + echo "{{.GITHUB_ACTIONS_TEMPLATES_FOOTER}}" >> docs/github-action-templates.md |
| 41 | +
|
| 42 | + lint:markdown: |
| 43 | + desc: "Lint Markdown" |
| 44 | + cmds: |
| 45 | + # itkdev/markdownlint does not support `--ignore-path` |
| 46 | + - docker run --rm --volume "$PWD":/md peterdavehello/markdownlint markdownlint --config config/markdownlint-cli/.markdownlint.jsonc --ignore-path config/markdownlint-cli/.markdownlintignore '**/*.md' --fix |
| 47 | + - docker run --rm --volume "$PWD":/md peterdavehello/markdownlint markdownlint --config config/markdownlint-cli/.markdownlint.jsonc --ignore-path config/markdownlint-cli/.markdownlintignore '**/*.md' |
| 48 | + |
| 49 | + default: |
| 50 | + cmds: |
| 51 | + - task --list |
| 52 | + silent: true |
0 commit comments