Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 Add auto-fix to pipeline when Node.js CI fails #96

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 60 additions & 1 deletion .github/workflows/node.js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,68 @@ jobs:
version: latest
- uses: actions/setup-node@v4
with:
node-version: latest
cache: pnpm
node-version: latest
- run: pnpm install --frozen-lockfile --strict-peer-dependencies
- run: pnpm run build --noEmit
- run: pnpm run lint
- run: pnpm run test

fix:
runs-on: ubuntu-latest

permissions:
contents: write

if: github.event_name == 'pull_request' && failure() && github.actor != 'github-actions[bot]'

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: latest

- run: |
pnpm install --fix-lockfile --no-frozen-lockfile
git add .
- id: commit-lockfile
uses: qoomon/actions--create-commit@v1
with:
message: |
📌 pnpm install --fix-lockfile

[dependabot skip]
skip-empty: true

- run: |
pnpm run format
git add .
- id: commit-format
uses: qoomon/actions--create-commit@v1
with:
message: |
🎨 pnpm run format

[dependabot skip]
skip-empty: true

- run: |
pnpm run lint:fix
git add .
- id: commit-lint
uses: qoomon/actions--create-commit@v1
with:
message: |
🚨 pnpm run lint:fix

[dependabot skip]
skip-empty: true

- if: steps.commit-lockfile.outputs.commit || steps.commit-format.outputs.commit || steps.commit-lint.outputs.commit
run: git push
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22-slim AS base
FROM node:23-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
Expand Down
Loading