Skip to content

Commit 30d167c

Browse files
committed
fix: resolve CI race condition by limiting auto-fixes to Node.js 22.x only
1 parent cffac7c commit 30d167c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ jobs:
6363
- name: Install dependencies
6464
run: npm ci --legacy-peer-deps
6565

66-
# Auto-fix linting issues (only on push to main)
66+
# Auto-fix linting issues (only on push to main, only on Node.js 22.x to avoid race conditions)
6767
- name: Check for fixable linting issues
68-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
68+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.node-version == '22.x'
6969
id: check-fixes
7070
run: |
7171
git status --porcelain > before.txt
@@ -83,13 +83,13 @@ jobs:
8383
rm -f before.txt after.txt
8484
8585
- name: Auto-fix linting issues
86-
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.check-fixes.outputs.fixes-available == 'true'
86+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.node-version == '22.x' && steps.check-fixes.outputs.fixes-available == 'true'
8787
run: |
8888
npm run lint:fix
8989
npm run format
9090
9191
- name: Commit auto-fixes
92-
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.check-fixes.outputs.fixes-available == 'true'
92+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.node-version == '22.x' && steps.check-fixes.outputs.fixes-available == 'true'
9393
run: |
9494
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
9595
git config --local user.name "github-actions[bot]"

0 commit comments

Comments
 (0)