Skip to content

Conversation

@eabdelmoneim
Copy link
Collaborator

@eabdelmoneim eabdelmoneim commented Dec 15, 2025

Remove hardcoded pnpm version 8 from workflows and let pnpm/action-setup automatically detect the version from package.json packageManager field ([email protected]).

This fixes the 'not compatible lockfile' error that was occurring because the lockfile was generated with pnpm 10 but the workflow was using pnpm 8.

Summary by CodeRabbit

  • Chores
    • CI now auto-reads the pnpm version from package.json instead of hardcoding it.
    • Improved PHP syntax checking in the build to capture and report all errors and fail on issues.
    • Updated artifact upload step to use a newer action version for reliability.

✏️ Tip: You can customize this high-level summary in your review settings.

Remove hardcoded pnpm version 8 from workflows and let pnpm/action-setup
automatically detect the version from package.json packageManager field
([email protected]).

This fixes the 'not compatible lockfile' error that was occurring because
the lockfile was generated with pnpm 10 but the workflow was using pnpm 8.
@coderabbitai
Copy link

coderabbitai bot commented Dec 15, 2025

Walkthrough

Two GitHub Actions workflows were updated: both workflows stop hardcoding a pnpm version and instead rely on the package.json packageManager field; the build workflow's PHP syntax step now collects all syntax errors, exits non‑zero if any are found, and prints a success message when none exist.

Changes

Cohort / File(s) Change Summary
pnpm version management
​.github/workflows/build.yml, ​.github/workflows/release.yml
Removed explicit pnpm version specification; workflows now read pnpm version from package.json packageManager (comment added indicating automatic reading).
PHP syntax check enhancement
​.github/workflows/build.yml
Replaced a simple grep-based check with logic that captures all php -l syntax errors into an ERRORS variable, exits non-zero when errors exist, and prints a success message when all PHP files are valid.
Artifact upload action version
​.github/workflows/build.yml
Updated the upload-artifact action reference to a newer action version.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Pay attention to the PHP syntax-checking shell logic and exit codes in ​.github/workflows/build.yml.
  • Verify the pnpm behavior reads the intended version from package.json (check packageManager field format).
  • Confirm the updated upload-artifact action version is compatible with the workflow steps.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately and concisely summarizes the main change: removing hardcoded pnpm version 8 and allowing automatic detection from package.json's packageManager field.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch eiman/action-sha-commits

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a0531b6 and 7402cb1.

📒 Files selected for processing (1)
  • .github/workflows/build.yml (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/build.yml

Comment @coderabbitai help to get the list of available commands and usage tips.

The grep command was returning exit code 1 when no syntax errors were
found, causing the workflow to fail. Fixed by:
- Capturing output in a variable with '|| true' to handle grep exit codes
- Checking if errors exist before failing
- Providing clear success/failure messages
Upgraded from v3.2.1-node20 to v4.6.2 to fix artifact upload failures.
The v3 version had stricter naming requirements and compatibility issues.

Changes:
- actions/upload-artifact: v3.2.1-node20 → v4.6.2
- SHA: c24449f → ea165f8 (verified)

v4 provides better artifact naming support and improved reliability.
@eabdelmoneim eabdelmoneim merged commit 4cda909 into main Dec 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants