-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (50 loc) · 1.34 KB
/
api-formatting-linting.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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