Skip to content

Run Linter and Formatter on 227 feat add entry list to sidebar by huilensolis #30

Run Linter and Formatter on 227 feat add entry list to sidebar by huilensolis

Run Linter and Formatter on 227 feat add entry list to sidebar by huilensolis #30

name: Api Formatting and Linting
run-name: Run Linter and Formatter on ${{ github.event.pull_request.title }} by ${{ github.event.sender.login }}
on:
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
formatting:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: apps/api
environment: Preview
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest # or "latest", "canary", <sha>
- name: Install dependencies
run: bun install
- name: Format
run: bun run format
- uses: EndBug/add-and-commit@v9 # You can change this to use a specific version.
with:
author_name: Github Action
message: "format(api): formatt code"
push: true
linting:
needs: formatting
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: apps/api
environment: Preview
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest # or "latest", "canary", <sha>
- name: Install dependencies
run: bun install
- name: Lint
run: bun run lint