Skip to content

ci: skip ecosystem-e2e on forks#12541

Merged
zkochan merged 1 commit into
pnpm:mainfrom
btea:ci/prevent-ecosystem-e2e-for-forks
Jun 20, 2026
Merged

ci: skip ecosystem-e2e on forks#12541
zkochan merged 1 commit into
pnpm:mainfrom
btea:ci/prevent-ecosystem-e2e-for-forks

Conversation

@btea

@btea btea commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

To prevent frequent error emails from being received due to the failure of scheduled workflow execution when forking the repository.

Squash Commit Body

Explain what changed and why. Reference issues here too (Closes pnpm/pnpm#123).

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pacquet/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.
  • Updated the documentation if needed.

Summary by CodeRabbit

  • Chores
    • Updated continuous integration workflow configuration.

@btea btea requested a review from zkochan as a code owner June 20, 2026 13:17
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 696c64e5-644d-41a9-b01f-419719a471c5

📥 Commits

Reviewing files that changed from the base of the PR and between 12baab4 and 9e7abff.

📒 Files selected for processing (1)
  • .github/workflows/ecosystem-e2e.yml

📝 Walkthrough

Walkthrough

Two if: github.repository == 'pnpm/pnpm' conditions are added to .github/workflows/ecosystem-e2e.yml: one on the build job and one on the ecosystem-e2e matrix job, preventing both from running on fork repositories.

Changes

Ecosystem E2E Workflow Fork Guard

Layer / File(s) Summary
Repository guard conditions on build and ecosystem-e2e jobs
.github/workflows/ecosystem-e2e.yml
Adds if: github.repository == 'pnpm/pnpm' to both the build job (line 28) and the ecosystem-e2e matrix job (line 64), gating execution to the upstream repository only.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Assessment against linked issues

Objective Addressed Explanation
Update npm dependency to version 3.7.3 [#123] This PR modifies CI workflow conditions and makes no changes to any npm dependency version.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Repository guard conditions added to build and ecosystem-e2e jobs (.github/workflows/ecosystem-e2e.yml, lines 28, 64) These CI workflow changes are unrelated to the npm version update described in issue #123.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

CI: Skip ecosystem E2E workflow jobs on forks
⚙️ Configuration changes 🕐 Less than 5 minutes

Grey Divider

Description

• Gate Ecosystem E2E build job to run only in pnpm/pnpm repository.
• Gate Ecosystem E2E matrix job to run only in pnpm/pnpm repository.
• Prevent scheduled workflow failures and resulting error emails on forks.
Diagram

graph TD
  A["GitHub Actions trigger"] --> B{"Main repo?"} --> C["E2E Build job"] --> D["E2E Matrix job"]
  B --> E["Skip jobs"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Gate only scheduled runs
  • ➕ Still allows ad-hoc/manual runs on forks if desired
  • ➕ More targeted to the reported failure mode (schedule on forks)
  • ➖ Slightly more complex condition logic (event-name branching)
  • ➖ Still permits other fork-triggered runs to consume CI resources
2. Use org/owner check instead of full repo slug
  • ➕ More resilient if the repository is renamed or moved within the org
  • ➕ Shorter condition (e.g., github.repository_owner == 'pnpm')
  • ➖ Potentially broader than intended if other repos in the org should not run this workflow
  • ➖ Less explicit than checking the canonical repo full name

Recommendation: The current approach (job-level if: github.repository == 'pnpm/pnpm') is the simplest and most explicit way to prevent fork executions (including scheduled runs) without impacting runs in the canonical repository. Consider gating only schedule if you explicitly want forks to be able to run these jobs manually.

Files changed (1) +2 / -0

Other (1) +2 / -0
ecosystem-e2e.ymlSkip Ecosystem E2E jobs when running in forks +2/-0

Skip Ecosystem E2E jobs when running in forks

• Adds a repository guard to both the build job and the ecosystem-e2e matrix job. This prevents the workflow from executing on forked repositories, avoiding scheduled-run failures and associated error emails.

.github/workflows/ecosystem-e2e.yml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 20, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Informational

1. Fork dispatch now blocked 🐞 Bug ⚙ Maintainability
Description
The new job-level condition if: github.repository == 'pnpm/pnpm' disables both schedule and
workflow_dispatch runs on forks, so fork owners can’t manually run Ecosystem E2E in their own repo
anymore. This is broader than the stated goal (stop scheduled fork failures) and may remove a useful
debugging/testing path for fork maintainers.
Code

.github/workflows/ecosystem-e2e.yml[28]

+    if: github.repository == 'pnpm/pnpm' # Only run on the main repository, not forks
Evidence
The workflow is triggered by both workflow_dispatch and schedule, but the new job-level if
gates execution solely on the repository name, which evaluates false on forks for both triggers.

.github/workflows/ecosystem-e2e.yml[14-18]
.github/workflows/ecosystem-e2e.yml[27-66]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The workflow currently skips jobs on forks for *all* triggers, including `workflow_dispatch`.
### Issue Context
The stated intent is to stop scheduled runs on forks, but the workflow also supports manual runs (`workflow_dispatch`).
### Fix
Adjust the job `if:` to only block scheduled runs on forks, e.g.:
- `if: github.event_name != 'schedule' || github.repository == 'pnpm/pnpm'`
### Fix Focus Areas
- .github/workflows/ecosystem-e2e.yml[14-18]
- .github/workflows/ecosystem-e2e.yml[27-66]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit 9e7abff

Results up to commit 9e7abff


🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)


Informational
1. Fork dispatch now blocked 🐞 Bug ⚙ Maintainability
Description
The new job-level condition if: github.repository == 'pnpm/pnpm' disables both schedule and
workflow_dispatch runs on forks, so fork owners can’t manually run Ecosystem E2E in their own repo
anymore. This is broader than the stated goal (stop scheduled fork failures) and may remove a useful
debugging/testing path for fork maintainers.
Code

.github/workflows/ecosystem-e2e.yml[28]

+    if: github.repository == 'pnpm/pnpm' # Only run on the main repository, not forks
Evidence
The workflow is triggered by both workflow_dispatch and schedule, but the new job-level if
gates execution solely on the repository name, which evaluates false on forks for both triggers.

.github/workflows/ecosystem-e2e.yml[14-18]
.github/workflows/ecosystem-e2e.yml[27-66]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The workflow currently skips jobs on forks for *all* triggers, including `workflow_dispatch`.

### Issue Context
The stated intent is to stop scheduled runs on forks, but the workflow also supports manual runs (`workflow_dispatch`).

### Fix
Adjust the job `if:` to only block scheduled runs on forks, e.g.:
- `if: github.event_name != 'schedule' || github.repository == 'pnpm/pnpm'`

### Fix Focus Areas
- .github/workflows/ecosystem-e2e.yml[14-18]
- .github/workflows/ecosystem-e2e.yml[27-66]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jun 20, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 9e7abff

@zkochan zkochan enabled auto-merge (squash) June 20, 2026 16:38
@zkochan zkochan disabled auto-merge June 20, 2026 18:18
@zkochan zkochan merged commit f6dde62 into pnpm:main Jun 20, 2026
21 checks passed
@btea btea deleted the ci/prevent-ecosystem-e2e-for-forks branch June 21, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviewed: coderabbit CodeRabbit submitted an approving review state: automerge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants