Skip to content

[STG-2257] fix(ci): skip Stainless jobs for fork PRs#2243

Merged
shrey150 merged 1 commit into
mainfrom
shrey/stainless-skip-fork-prs
Jun 12, 2026
Merged

[STG-2257] fix(ci): skip Stainless jobs for fork PRs#2243
shrey150 merged 1 commit into
mainfrom
shrey/stainless-skip-fork-prs

Conversation

@shrey150

@shrey150 shrey150 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Fork-triggered pull_request workflow runs don't receive repo configuration variables or secrets, so STAINLESS_ORG/STAINLESS_PROJECT arrive empty and the Stainless action dies immediately with Input required and not supplied: project on every external-contributor PR. Seen on #2241 (claimed copy of #2240): the fork PR's failing preview check attached to the shared head SHA, leaving the claimed PR red through no fault of its own.

This guards both jobs on github.event.pull_request.head.repo.full_name == github.repository:

  • preview — skips on fork PRs instead of failing. Claimed copies of external PRs run in-repo, so SDK preview coverage is preserved.
  • merge — same defect: a directly-merged fork PR would trigger a guaranteed-failing merge build (still no vars/secrets on the closed event). Skipping is strictly better than failing; the claim flow means merged external work is always in-repo anyway.

The full_name comparison is used instead of !head.repo.fork so a deleted fork repo (head.repo == null) skips rather than runs-and-fails.

Linear: STG-2257

E2E Test Matrix

Command / flow Observed output Confidence / sufficiency
Failing fork run: actions/runs/27375420406 (triggered by fork PR #2240) Env dump shows STAINLESS_ORG: and STAINLESS_PROJECT: empty; action exits with Error: Input required and not supplied: project Proves the root cause is withheld vars on fork runs, not the spec or config — exactly the case the new guard skips
actionlint .github/workflows/stainless.yml on this branch Exit 0, no findings Validates workflow schema and the new if: expression syntax
preview check on this PR (in-repo branch) See checks below — job runs (guard evaluates true for same-repo PRs) and builds SDK previews Live proof the guard doesn't skip in-repo PRs; the fork-skip path can only be exercised by the next real fork PR

🤖 Generated with Claude Code


Summary by cubic

Skip Stainless CI jobs for fork-origin PRs to avoid failures from missing repo vars/secrets. Keeps external PRs green while coverage runs on in-repo “claimed” copies. Addresses Linear STG-2257.

  • Bug Fixes
    • Skip preview and merge unless github.event.pull_request.head.repo.full_name == github.repository; merge still requires closed+merged into main.
    • Use the full_name check to safely skip deleted forks (head.repo can be null).

Written for commit 58c5891. Summary will update on new commits.

Review in cubic

Fork-triggered pull_request runs don't receive repo configuration
variables or secrets, so STAINLESS_ORG/STAINLESS_PROJECT arrive empty
and the Stainless action fails with 'Input required and not supplied:
project' on every external PR (e.g. #2240/#2241). Skip both jobs when
the head repo isn't browserbase/stagehand — claimed copies of external
PRs run in-repo and still get full coverage.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 58c5891

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@shrey150 shrey150 merged commit 02d16b0 into main Jun 12, 2026
36 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