Skip to content

Commit 86227aa

Browse files
committed
feat: add automatic formatting to CI workflow to prevent prettier errors
1 parent 1df57e6 commit 86227aa

2 files changed

Lines changed: 40 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010
lint-and-format:
1111
name: Lint & Format Check
1212
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
1315
steps:
1416
- name: Checkout code
1517
uses: actions/checkout@v4
@@ -31,8 +33,28 @@ jobs:
3133
- name: Run ESLint
3234
run: pnpm exec eslint "**/*.{ts,js}" --ignore-path .gitignore
3335

34-
- name: Check Prettier formatting
35-
run: pnpm exec prettier --check .
36+
- name: Auto-format files
37+
run: pnpm exec prettier --write .
38+
39+
- name: Check if formatting changed files
40+
id: format_check
41+
run: |
42+
if [[ -n $(git diff --name-only) ]]; then
43+
echo "formatted_files=true" >> $GITHUB_OUTPUT
44+
echo "Files were auto-formatted:"
45+
git diff --name-only
46+
else
47+
echo "formatted_files=false" >> $GITHUB_OUTPUT
48+
echo "✅ All files already properly formatted"
49+
fi
50+
51+
- name: Commit auto-formatted files
52+
if: steps.format_check.outputs.formatted_files == 'true'
53+
run: |
54+
git config --local user.email "action@github.com"
55+
git config --local user.name "GitHub Action"
56+
git add .
57+
git commit -m "style: auto-format files with prettier [skip ci]" || exit 0
3658
3759
- name: TypeScript type check
3860
run: pnpm exec tsc --noEmit

nodes/Scrappey/Scrappey.node.json

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
{
2-
"node": "n8n-nodes-scrappey",
3-
"nodeVersion": "0.3.1",
4-
"codexVersion": "0.3.1",
5-
"categories": [
6-
"Development",
7-
"Web Scraping"
8-
],
9-
"resources": {
10-
"credentialDocumentation": [
11-
{
12-
"url": "https://nodes.n8n.community/scrappey/signup"
13-
}
14-
],
15-
"primaryDocumentation": [
16-
{
17-
"url": "https://wiki.scrappey.com"
18-
}
19-
]
20-
}
2+
"node": "n8n-nodes-scrappey",
3+
"nodeVersion": "0.3.1",
4+
"codexVersion": "0.3.1",
5+
"categories": ["Development", "Web Scraping"],
6+
"resources": {
7+
"credentialDocumentation": [
8+
{
9+
"url": "https://nodes.n8n.community/scrappey/signup"
10+
}
11+
],
12+
"primaryDocumentation": [
13+
{
14+
"url": "https://wiki.scrappey.com"
15+
}
16+
]
17+
}
2118
}

0 commit comments

Comments
 (0)