File tree Expand file tree Collapse file tree 5 files changed +50
-0
lines changed
Expand file tree Collapse file tree 5 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 1212 # Check that documentation has not changed.
1313 - run : |
1414 git diff --exit-code docs/github-action-templates.md
15+
16+ check-github-actions-documentation :
17+ runs-on : ubuntu-latest
18+ name : Check that Github Actions documentation is up to date
19+ steps :
20+ - uses : actions/checkout@v4
21+ - uses : arduino/setup-task@v2
22+ - run : |
23+ task github-actions:update-headers --yes
24+ # Check that files hav not changed.
25+ - run : |
26+ git diff --exit-code github/workflows/
Original file line number Diff line number Diff line change @@ -41,6 +41,32 @@ tasks:
4141 # Link to clean up.
4242 - task lint:markdown -- docs/github-action-templates.md
4343
44+ github-actions:update-headers :
45+ prompt : " Updating headers may break things, so check result afterwards. Really update headers?"
46+ desc : " Update headers in GitHub Actions templates"
47+ cmds :
48+ - |
49+ for f in github/workflows/*.yaml; do
50+ echo "$f"
51+ # If file starts with `# ` …
52+ if [[ $(head --lines=1 "$f") =~ "^# " ]]; then
53+ # … replace the header.
54+ # This is done by deleting all lines from the top of the file to a blank line.
55+ docker run --rm --volume=$PWD:/app itkdev/php8.3-fpm:latest sed -i '1,/^$/d' "$f"
56+ fi
57+
58+ # Write header and file into temporary file.
59+ (
60+ echo "# Do not edit this file! Make a pull request on changing";
61+ echo "# $f in";
62+ echo "# https://github.com/itk-dev/devops_itkdev-docker if need be.";
63+ echo "";
64+ cat "$f"
65+ ) > "$f.tmp"
66+ # Replace original file with temporary file.
67+ mv "$f.tmp" "$f"
68+ done
69+
4470 lint:markdown :
4571 desc : " Lint Markdown"
4672 cmds :
Original file line number Diff line number Diff line change 1+ # Do not edit this file! Make a pull request on changing
2+ # github/workflows/composer.yaml in
3+ # https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
15# ## ## Composer
26# ##
37# ## Validates composer.json and checks that it's normalized.
Original file line number Diff line number Diff line change 1+ # Do not edit this file! Make a pull request on changing
2+ # github/workflows/drupal.yaml in
3+ # https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
15# ## ## Drupal
26# ##
37# ## Checks that site can be installed and can be updated (from base branch on
Original file line number Diff line number Diff line change 1+ # Do not edit this file! Make a pull request on changing
2+ # github/workflows/markdown.yaml in
3+ # https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
15# ## ## Markdown
26# ##
37# ## Uses [itkdev/markdownlint](https://hub.docker.com/r/itkdev/markdownlint) to
You can’t perform that action at this time.
0 commit comments