Skip to content

Commit

Permalink
Merge pull request #8 from kalcohol/main-update-format
Browse files Browse the repository at this point in the history
update more format
  • Loading branch information
kalcohol authored Dec 5, 2024
2 parents f2ab9df + f27bd92 commit 4ed68b8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/auto_format_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Format Code

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
format:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "16"

- name: Install Prettier
run: |
npm install --save-dev prettier
- name: Format YAML and Markdown files
run: |
npx prettier --write "**/*.yaml" "**/*.yml" "**/*.md"
- name: Check for changes
id: check_changes
run: |
git diff --exit-code || echo "Changes detected"
- name: Commit changes
if: steps.check_changes.outputs.exit_code != 0
run: |
git config --local user.name "github-actions"
git config --local user.email "[email protected]"
git add .
git commit -m "Format YAML and Markdown files with Prettier" || echo "No changes to commit"
git push
File renamed without changes.

0 comments on commit 4ed68b8

Please sign in to comment.