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

.github/workflows/fix.yaml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/node.js.yaml

Lines changed: 70 additions & 3 deletions
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

package.json

Lines changed: 1 addition & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy