Skip to content

Commit 2e13b76

Browse files
authored
👷 Fix the auto-fix workflow (#228)
It should now only run if the pipeline fails.
1 parent 426f867 commit 2e13b76

File tree

3 files changed

+71
-44
lines changed

3 files changed

+71
-44
lines changed

Diff for: .github/workflows/fix.yaml

-41
This file was deleted.

Diff for: .github/workflows/node.js.yaml

+70-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
name: Node.js CI
22

33
on:
4-
push:
5-
branches: main
4+
merge_group:
5+
branches:
6+
- main
67
pull_request:
7-
branches: main
8+
branches:
9+
- main
10+
push:
11+
branches:
12+
- main
813

914
jobs:
1015
test:
@@ -22,3 +27,65 @@ jobs:
2227
- run: pnpm install --frozen-lockfile --strict-peer-dependencies
2328
- run: pnpm run build
2429
- run: pnpm run lint
30+
31+
fix:
32+
runs-on: ubuntu-latest
33+
34+
permissions:
35+
contents: write
36+
37+
needs:
38+
- test
39+
40+
if: failure() && github.event_name != 'merge_group' && github.actor != 'github-actions[bot]' && github.actor != 'nektos/act'
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
with:
45+
ref: ${{ github.ref }}
46+
- uses: pnpm/action-setup@v4
47+
with:
48+
version: latest
49+
- uses: actions/setup-node@v4
50+
with:
51+
cache: pnpm
52+
node-version: 22
53+
54+
- run: |
55+
pnpm install --fix-lockfile --no-frozen-lockfile
56+
git add .
57+
- id: commit-lockfile
58+
uses: qoomon/actions--create-commit@v1
59+
with:
60+
message: |
61+
📌 pnpm install --fix-lockfile
62+
63+
[dependabot skip]
64+
skip-empty: true
65+
66+
- run: |
67+
pnpm run format
68+
git add .
69+
- id: commit-format
70+
uses: qoomon/actions--create-commit@v1
71+
with:
72+
message: |
73+
🎨 pnpm run format
74+
75+
[dependabot skip]
76+
skip-empty: true
77+
78+
- run: |
79+
pnpm run lint:fix
80+
git add .
81+
- id: commit-lint
82+
uses: qoomon/actions--create-commit@v1
83+
with:
84+
message: |
85+
🚨 pnpm run lint:fix
86+
87+
[dependabot skip]
88+
skip-empty: true
89+
90+
- if: steps.commit-lockfile.outputs.commit || steps.commit-format.outputs.commit || steps.commit-lint.outputs.commit
91+
run: git push

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"deploy": "docusaurus deploy",
1212
"clear": "docusaurus clear",
1313
"serve": "docusaurus serve",
14+
"format": "prettier --write .",
1415
"lint": "markdownlint-cli2 \"**/*.md\" && prettier --check .",
1516
"lint:fix": "markdownlint-cli2 \"**/*.md\" --fix; prettier --list-different --write .",
1617
"write-translations": "docusaurus write-translations",

0 commit comments

Comments
 (0)