-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (54 loc) · 1.83 KB
/
Copy pathlint.yaml
File metadata and controls
67 lines (54 loc) · 1.83 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: "Linting and Formatting"
on:
pull_request:
branches: ["**"]
env:
NODE_VERSION: 20.16.0
permissions:
contents: write # Required for modifying files and creating PRs
pull-requests: write # Required for creating PRs
jobs:
lint:
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Node setup
uses: actions/setup-node@v4
with:
node-version: $NODE_VERSION
- name: Installation
run: npm ci
- name: Run linter
run: npm run lint:check
format:
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Node setup
uses: actions/setup-node@v4
with:
node-version: $NODE_VERSION
- name: Installation
run: npm ci
- name: Run formatter
run: npm run pretty:fix
- name: Commit changes
env:
ORIGINAL_PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
git config --global user.name 'DevUnityBot'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "refactor: applied code formatting for PR #${ORIGINAL_PR_NUMBER}"
git push origin HEAD:pretty-fix
- name: Create PR
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "refactor: applied code formatting for PR #${{ github.event.pull_request.number }}"
branch: pretty-fix
title: "refector: formatting fixed for PR #${{ github.event.pull_request.number }}"
body: |
Prettier fixes for the original PR #${{ github.event.pull_request.number }}.