Skip to content

Commit 7fb8ebb

Browse files
authored
Merge pull request #199 from Bashamega/format-fix
Update format.yml
2 parents 9cacba8 + 6cf0239 commit 7fb8ebb

File tree

6 files changed

+41
-22
lines changed

6 files changed

+41
-22
lines changed

.github/workflows/format.yml

+34-15
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,45 @@
1-
2-
name: Prettier Styling
1+
name: Format Documents
32

43
on:
5-
pull_request:
64
push:
75
branches:
86
- '**'
7+
pull_request:
8+
branches:
9+
- '**'
10+
911

1012
jobs:
11-
prettier:
13+
run-script:
1214
runs-on: ubuntu-latest
1315

1416
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v3
17-
with:
18-
# Make sure the actual branch is checked out when running on pull requests
19-
ref: ${{ github.head_ref }}
20-
21-
- name: Prettify code
22-
uses: creyD/[email protected]
23-
with:
24-
# This will prettify all files in the repository
25-
prettier_options: --write src/.
17+
- name: Checkout repository
18+
uses: actions/checkout@v2
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: '14' # You can specify the Node.js version here
26+
27+
- name: Install dependencies
28+
run: npm install
29+
30+
- name: Run script
31+
run: npx prettier src/. --write
32+
33+
- name: Configure git
34+
run: |
35+
git config --global user.name 'github-actions[bot]'
36+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
37+
38+
- name: Commit changes
39+
run: |
40+
git add .
41+
git commit -m "Format"
42+
git push origin HEAD:${{ github.ref }}
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2645
continue-on-error: true

src/app/MD/page.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,4 @@ export default function MarkdownEditor() {
194194
</section>
195195
</main>
196196
);
197-
}
197+
}

src/app/components/icons/moonicon.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React from "react";
22

33
const MoonIcon = ({ className = "" }) => (
44
<svg
@@ -17,4 +17,4 @@ const MoonIcon = ({ className = "" }) => (
1717
</svg>
1818
);
1919

20-
export default MoonIcon;
20+
export default MoonIcon;

src/app/components/icons/sunicon.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React from "react";
22

33
const SunIcon = ({ className = "" }) => (
44
<svg
@@ -25,4 +25,4 @@ const SunIcon = ({ className = "" }) => (
2525
</svg>
2626
);
2727

28-
export default SunIcon;
28+
export default SunIcon;

src/app/components/nav.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,4 +280,4 @@ export default function Nav({ isDarkMode, toggleTheme }) {
280280
</div>
281281
</nav>
282282
);
283-
}
283+
}

src/app/components/navbar.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ export function NavBar({ title, isDarkMode, toggleTheme }) {
5252
</div>
5353
</nav>
5454
);
55-
}
55+
}

0 commit comments

Comments
 (0)