Skip to content

Complete re-write

Complete re-write #8

Workflow file for this run

name: Format code
on:
pull_request:
branches:
- main
- develop
jobs:
format:
runs-on: ubuntu-latest
permissions:
# To commit and push the changed files
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
# Alternative
# - name: Cache node modules
# uses: actions/cache@v3
# env:
# cache-name: cache-node-modules
# with:
# path: ~/.pnpm-store
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
- name: Install Dependencies
run: pnpm i --frozen-lockfile
- name: Run format
run: pnpm format
# Source: https://github.com/marketplace/actions/git-auto-commit
- id: auto-commit-changes
name: "Auto commit changes"
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "style(auto): formatting"
skip_dirty_check: false