-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from kalcohol/main-update-format
update more format
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.