-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (39 loc) · 1.36 KB
/
pretty-code.yml
File metadata and controls
52 lines (39 loc) · 1.36 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
name: Pretty Code 🎀
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install Node.js dependencies
run: |
npm i -g prettier
- name: Format with prettier
run: |
prettier --write "**/{*.jsx,*.js,*.tsx,*.ts,*.css}"
- name: Check for changes
id: changes
run: |
if [[ $(git status --porcelain) ]]; then
echo "is_formatted=true" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.changes.outputs.is_formatted == 'true'
uses: peter-evans/create-pull-request@v5
with:
branch: "code-formated-by-prettier-using-github-actions"
labels: |
prettier
automated pr
token: ${{ secrets.PULL_REQUEST_ACTION }}
title: "Code Formated 🤖 BeepBoop"
commit-message: "style(🤖): 🎨 scripts formated with Prettier"
body: |
There seems to be some formatting issues with this pull request. I have auto formatted the code using Prettier. Review the changes and merge this pull request if that's okay with you.