Skip to content

Commit

Permalink
chore: Add action to run tidy on pushes to the gh-pages branch.
Browse files Browse the repository at this point in the history
Whenever new commits are pushed, run tidy on `index.html` and create a pull
request with the reformatted file if necessary.
  • Loading branch information
Raphael Kubo da Costa committed Aug 25, 2021
1 parent 5331fa5 commit 49fa684
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/tidy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run tidy on spec
on:
push:
branches:
- "gh-pages"
paths:
- "index.html"

jobs:
tidy:
name: Reformat index.html if necessary
# We need macos-latest because tidy-2:5.6.0 which is present on all Ubuntu
# releases supported by GitHub actions has a bug that causes the documents
# to be wrongly formatted.
# https://github.com/w3c/screen-wake-lock/pull/319 has more details.
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- run: brew install tidy-html5
- run: tidy -config tidyrc -modify index.html
- uses: peter-evans/create-pull-request@v3
with:
body: |
Automated change.
`index.html` reformatted with `tidy -config tidyrc -modify index.html`.
branch: html-tidy
commit-message: "chore: Reformat document using tidy-html5"
delete-branch: true
title: "chore(tidy): reformat index.html"

0 comments on commit 49fa684

Please sign in to comment.