Skip to content

Commit

Permalink
👷 Add auto-fix to pipeline when Node.js CI fails (#96)
Browse files Browse the repository at this point in the history
* 👷 Add auto-fix to pipeline when Node.js CI fails

* ⬆️ FROM node:23-slim AS base
  • Loading branch information
NatoBoram authored Feb 3, 2025
1 parent 05ce1ca commit 62f0943
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
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

0 comments on commit 62f0943

Please sign in to comment.