Skip to content

Commit

Permalink
chore: add format workflow (remix-run#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Dec 12, 2022
1 parent 348627f commit 9e1d848
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: πŸ‘” Format

on:
push:
branches:
- main

jobs:
format:
if: github.repository == 'remix-run/react-router-website'
runs-on: ubuntu-latest

steps:
- name: πŸ›‘ Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v3

- name: βŽ” Setup node
uses: actions/setup-node@v3
with:
cache: npm
node-version: 18

- name: πŸ“₯ Install deps
run: npm ci

- name: πŸ‘” Format
run: npm run format

- name: πŸ’ͺ Commit
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
if [ -z "$(git status --porcelain)" ]; then
echo "πŸ’Ώ no formatting changed"
exit 0
fi
git commit -m "chore: format"
git push
echo "πŸ’Ώ pushed formatting changes https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
"dev": "run-p dev:*",
"dev:css": "npm run generate:css -- --watch",
"dev:remix": "remix dev",
"format": "prettier --write .",
"format": "prettier --write . && npm run lint:fix",
"generate:css": "postcss app/styles.source.css -o app/styles.processed.css",
"lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
"lint:fix": "npm run lint -- --fix",
"start": "remix-serve build",
"test": "vitest",
"typecheck": "tsc -b"
Expand Down

0 comments on commit 9e1d848

Please sign in to comment.