Gwk-Cultural-Park/.github/workflows/prettier.yml
2024-09-07 08:40:25 +07:00

35 lines
1.1 KiB
YAML

---
name: Prettier
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
run:
name: Can the code be prettier? 🤔
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
cache: npm
node-version: lts/*
- run: npm ci --ignore-scripts --only-dev
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
with:
path: node_modules/.cache/prettier/.prettier-cache
key: prettier-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.gitignore') }}
- run: npx prettier --ignore-path .gitignore --cache --write .
- run: git restore .github/workflows
- uses: EndBug/add-and-commit@61a88be553afe4206585b31aa72387c64295d08b # tag=v9
with:
default_author: github_actions
commit: --no-verify
message: 'chore(prettier): 🤖 ✨'