✨ [feat] Enhance package.json with new features and improvements #160
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Prettier | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: prettier-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| prettier: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version-file: .node-version | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - name: Cache node modules | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 | |
| with: | |
| path: ./node_modules | |
| key: ${{ runner.os }}-.-node-modules-${{ hashFiles('./package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-.-node-modules- | |
| - name: Install Prettier | |
| run: npm install --no-save prettier | |
| - name: Prettify code | |
| uses: creyD/prettier_action@8c18391fdc98ed0d884c6345f03975edac71b8f0 # v4.6 | |
| with: | |
| prettier_options: --check **/*.{js,md,css,html} | |
| continue-on-error: true |