Skip to content

Update prettier.yml

Update prettier.yml #2

Workflow file for this run

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 'prettier/$BASE_BRANCH'
if [ $(gh pr list --json id -B $BASE_BRANCH -s open) == '[]' ]
then
gh pr create --base $BASE_BRANCH --fill --label bot
fi