-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (28 loc) · 935 Bytes
/
prettier-html.yml
File metadata and controls
36 lines (28 loc) · 935 Bytes
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
name: Prettify gh-pages
on:
workflow_dispatch:
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Find and Remove </source> Tags
run: find . -type f -name "*.html" -exec sed -i 's/<\/source>//g' {} +
- name: Set up Node.js
uses: actions/setup-node@v4
- name: Install Prettier
run: npm install -g prettier
- name: Check for Prettier
run: npx prettier --version || echo "Prettier not found"
- name: Run Prettier on HTML files
run: npx prettier --write '**/*.html'
- name: Commit and push changes
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add .
git commit -m "Formatted HTML files" || echo "No changes to commit"
git push