Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added gh-pages Formatter #2649

Merged
merged 6 commits into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/prettier-html.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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'
MUmarShahbaz marked this conversation as resolved.
Show resolved Hide resolved

- 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