Skip to content

Commit

Permalink
Merge pull request #914 from remix-run/logan/format-action
Browse files Browse the repository at this point in the history
chore(ci): add format action
  • Loading branch information
ryanflorence authored Jan 5, 2022
2 parents 8bef6f4 + eac4edd commit 3966191
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Format

on:
push:
branches:
- main

jobs:
format:
runs-on: ubuntu-latest

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1

- name: Checkout Repository
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 14

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Format
run: npm run format --if-present

- name: Commit
run: |
git config --local user.email "github-actions@remix.run"
git config --local user.name "Remix Run Bot"
git add .
if [ -z "$(git status --porcelain)" ]; then
echo "💿 no formatting changed"
exit 0
fi
git commit -m "chore: format" -m "formatted $GITHUB_SHA"
git push
echo "💿 pushed formatting changes https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"

0 comments on commit 3966191

Please sign in to comment.