Skip to content

Commit

Permalink
Create prettier.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
FineArchs authored Jan 25, 2024
1 parent 58eb86d commit adec53d
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Prettier

on:
push:
workflow_dispatch:

jobs:
format:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
- uses: actions/cache@v4
id: cache
with:
path: node_modules
key: node_modules-${{ hashFiles('package-lock.json') }}-18
- run: npm ci
if: steps.cache.outputs.cache-hit != 'true'
- run: npm run prettier
- name: Create or Update PR
run: |
BASE_BRANCH=$( git rev-parse --abbrev-ref HEAD )
git config --global user.email "[email protected]"
git config --global user.name "FineArchs"
git add .
git commit -m'prettier $BASE_BRANCH'
git branch -m 'prettier/$BASE_BRANCH'
git push -f -u origin '$BASE_BRANCH'
if [ $(gh pr list --json id -B $BASE_BRANCH -s open) == '[]' ]
then
gh pr create --base $BASE_BRANCH --fill --label bot
fi

0 comments on commit adec53d

Please sign in to comment.