Skip to content

Commit

Permalink
chore: add format workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Apr 26, 2023
1 parent 0b50079 commit f5c921d
Showing 1 changed file with 44 additions and 0 deletions.
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

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
format:
if: github.repository == 'eslint-community/eslint-plugin/promise'
runs-on: ubuntu-latest

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

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: 📥 Install deps
run: npm install

- 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 f5c921d

Please sign in to comment.