Skip to content

Commit

Permalink
add format workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Dec 21, 2024
1 parent 144b70c commit fde5ef2
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 👔 Format

on:
workflow_dispatch: null

jobs:
format:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
- name: Install deps
run: npm i -f
- 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)"

0 comments on commit fde5ef2

Please sign in to comment.