Skip to content

ci: replace pnpm/action-setup with corepack (allowlist compliance)#18

Merged
ANcpLua merged 1 commit into
mainfrom
chore/ci-replace-pnpm-action-with-corepack
May 15, 2026
Merged

ci: replace pnpm/action-setup with corepack (allowlist compliance)#18
ANcpLua merged 1 commit into
mainfrom
chore/ci-replace-pnpm-action-with-corepack

Conversation

@ANcpLua
Copy link
Copy Markdown
Owner

@ANcpLua ANcpLua commented May 15, 2026

Summary

The post-merge CI run on main (after #16) failed with:

The action pnpm/action-setup@v4 is not allowed in ANcpLua/Paperless because all actions must be from a repository owned by ANcpLua, created by GitHub, or verified in the GitHub Marketplace.

This PR replaces both pnpm/action-setup@v4 blocks in .github/workflows/ci.yml (frontend-angular, frontend-react) with corepack, which ships with Node — no external action required.

  • Pinned to pnpm@10.30.2 to match PaperlessUI.Angular/package.json packageManager and the prior workflow's version: 10 (which floated to latest 10.x).
  • Corepack steps run BEFORE actions/setup-node@v4 so pnpm is on PATH when setup-node executes its cache: pnpm logic.
  • cache: pnpm + cache-dependency-path retained unchanged on both jobs.
  • actionlint clean.

Allowlist audit of remaining uses: (this workflow only)

action source status
actions/checkout@v4 GitHub-owned allowed
actions/setup-dotnet@v4 GitHub-owned allowed
actions/cache@v4 GitHub-owned allowed
actions/upload-artifact@v4 GitHub-owned allowed
actions/setup-node@v4 GitHub-owned allowed
codecov/codecov-action@v5 Marketplace verified publisher allowed (Codecov is a verified Marketplace publisher; ran fine on the same post-merge run that flagged pnpm/action-setup, so already on the allowlist)

No other disallowed actions noticed in ci.yml. Scope kept tight per request — no other workflow files were touched.

Test plan

  • CI on this PR: Build & Test (backend) green
  • CI on this PR: Build (PaperlessUI.Angular) runs corepack enable && corepack prepare pnpm@10.30.2 --activate, then setup-node@v4 with cache: pnpm resolves the pnpm store path, then pnpm install + pnpm run build succeed
  • CI on this PR: Build (PaperlessUI.React) same as above for the React project
  • After merge: post-merge run on main no longer fails the allowlist check

🤖 Generated with Claude Code

The org policy on ANcpLua/Paperless only permits actions from
ANcpLua-owned repos, GitHub-owned repos, or Marketplace-verified
publishers. `pnpm/action-setup@v4` falls outside that allowlist
and broke the post-merge CI run on main.

Corepack ships with Node and provides the same shim without an
external action. Pinned to pnpm@10.30.2 to match
PaperlessUI.Angular/package.json's `packageManager` field and the
prior workflow's `version: 10` (which floated to latest 10.x).

Corepack steps run BEFORE `actions/setup-node@v4` so pnpm is on
PATH when setup-node executes its `cache: pnpm` logic.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 15, 2026 15:46
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6af5167b-785d-4b5d-bbc9-ca2d57c081d7

📥 Commits

Reviewing files that changed from the base of the PR and between dd6f947 and bfd3060.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml
📜 Recent review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: copilot-pull-request-reviewer
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Build & Test (backend)
🧰 Additional context used
📓 Path-based instructions (1)
.github/workflows/*.yml

📄 CodeRabbit inference engine (CLAUDE.md)

Omit the token: ${{ secrets.CODECOV_TOKEN }} line in codecov CI action for public repos with tokenless OIDC upload

Files:

  • .github/workflows/ci.yml
🔇 Additional comments (1)
.github/workflows/ci.yml (1)

106-109: ⚡ Quick win

Centralize the pnpm pin to avoid cross-job version drift.

Line 109 and Line 130 duplicate pnpm@10.30.2. Keep the version in one place (top-level env) and reference it in both jobs to prevent silent divergence.

Also applies to: 127-130


📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated CI workflow configuration for frontend build jobs to optimize the package manager activation process.

Walkthrough

The CI workflow is updated to activate pnpm via Corepack at a pinned version (10.30.2) in both the Angular and React frontend build jobs, replacing the pnpm/action-setup@v4 action approach.

Changes

Frontend pnpm activation via Corepack

Layer / File(s) Summary
Angular and React pnpm setup via Corepack
.github/workflows/ci.yml
Both frontend-angular and frontend-react jobs replace pnpm/action-setup@v4 with Corepack-based activation and preparation of pnpm@10.30.2.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: replacing pnpm/action-setup with corepack for allowlist compliance.
Description check ✅ Passed The description is comprehensive and fully related to the changeset, detailing the rationale, implementation, and compliance considerations for the pnpm action replacement.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/ci-replace-pnpm-action-with-corepack
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch chore/ci-replace-pnpm-action-with-corepack

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Replaces the disallowed pnpm/action-setup@v4 action with corepack commands in both frontend CI jobs to satisfy the repository's action allowlist policy. Pins pnpm to 10.30.2 to match the Angular project's packageManager field, and runs the corepack activation before actions/setup-node@v4 so its cache: pnpm logic can locate pnpm on PATH.

Changes:

  • Replace pnpm/action-setup@v4 with corepack enable && corepack prepare pnpm@10.30.2 --activate in the frontend-angular job.
  • Apply the same replacement in the frontend-react job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

Copy link
Copy Markdown

@codacy-production codacy-production Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

While this PR correctly implements the requirement to replace pnpm/action-setup with Corepack for security compliance, it introduces a critical regression. The pnpm version 10.30.2 specified in the corepack prepare commands is non-existent (pnpm 10 currently has versions up to 10.4.x).

This discrepancy between the intended pinning and available versions will cause the CI pipeline to fail immediately during the preparation step. Although the workflow logic and ordering meet the acceptance criteria, the invalid version string must be corrected to pnpm@10 or a valid semantic version before merging.

About this PR

  • The PR attempts to pin pnpm to version 10.30.2, but this version does not exist. This will lead to a 'version not found' error across all CI jobs. Please verify the intended version or use the major version tag (e.g., pnpm@10).

Test suggestions

  • The frontend-angular job activates pnpm 10.30.2 using corepack before the setup-node step
  • The frontend-react job activates pnpm 10.30.2 using corepack before the setup-node step
  • Verify that actions/setup-node@v4 retains its cache: pnpm and cache-dependency-path settings

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

Comment thread .github/workflows/ci.yml
- name: Activate pnpm via corepack
run: |
corepack enable
corepack prepare pnpm@10.30.2 --activate
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 HIGH RISK

The version 10.30.2 is invalid and will cause the frontend-react job to fail. Use pnpm@10 to ensure the workflow uses a valid version from the v10 major release.

Suggested change
corepack prepare pnpm@10.30.2 --activate
corepack prepare pnpm@10 --activate

Comment thread .github/workflows/ci.yml
- name: Activate pnpm via corepack
run: |
corepack enable
corepack prepare pnpm@10.30.2 --activate
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 HIGH RISK

The version 10.30.2 is not a valid pnpm release. As of the current release cycle, pnpm 10 has not reached a '30.x' minor version. Attempting to prepare a non-existent version will cause the workflow to fail.

Suggested change
corepack prepare pnpm@10.30.2 --activate
corepack prepare pnpm@10 --activate

@ANcpLua ANcpLua merged commit 5dd2699 into main May 15, 2026
6 of 7 checks passed
@ANcpLua ANcpLua deleted the chore/ci-replace-pnpm-action-with-corepack branch May 15, 2026 16:14
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