Skip to content

Disable CI workflows on forked repositories#1232

Open
IeuanWalker wants to merge 2 commits intogithub:mainfrom
IeuanWalker:main
Open

Disable CI workflows on forked repositories#1232
IeuanWalker wants to merge 2 commits intogithub:mainfrom
IeuanWalker:main

Conversation

@IeuanWalker
Copy link
Copy Markdown

@IeuanWalker IeuanWalker commented May 8, 2026

When i forked and made some changes to the repo the other week, it automatically trigged github actions.
I don't think it's desirable/necessary to run the CI workflows on fork repositories as it's a lot of wasted action minutes.

Add if: github.event.repository.fork == false to all workflow jobs to ensure CI only runs in the main repository. This improves security and conserves resources by preventing workflow execution in forked repos.
Added a condition to the "Rust SDK Bundled CLI Build" job in rust-sdk-tests.yml to ensure it only runs when the workflow is triggered from the main repository, preventing execution on forked repositories.
@IeuanWalker IeuanWalker requested a review from a team as a code owner May 8, 2026 10:28
Copilot AI review requested due to automatic review settings May 8, 2026 10:28
Copy link
Copy Markdown
Contributor

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

Adds job-level fork guards to GitHub Actions workflows so CI jobs do not run in forked copies of the repository, reducing unnecessary runner usage while preserving CI behavior in the upstream repo.

Changes:

  • Gate CI/test/build jobs with if: github.event.repository.fork == false across multiple workflows.
  • Apply the same fork gating to scenario build verification, docs validation, codegen checks, and release/publish workflows.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/verify-compiled.yml Skip workflow recompilation verification job when running in a fork.
.github/workflows/scenario-builds.yml Skip all scenario build jobs (TS/Python/Go/C#/Rust) when running in a fork.
.github/workflows/rust-sdk-tests.yml Skip Rust SDK test and bundled-CLI build jobs when running in a fork.
.github/workflows/rust-publish-release.yml Prevent crates.io publish job from running in forks.
.github/workflows/python-sdk-tests.yml Skip Python SDK test job when running in a fork.
.github/workflows/nodejs-sdk-tests.yml Skip Node.js SDK test job when running in a fork.
.github/workflows/go-sdk-tests.yml Skip Go SDK test job when running in a fork.
.github/workflows/dotnet-sdk-tests.yml Skip .NET SDK test job when running in a fork.
.github/workflows/docs-validation.yml Skip docs validation jobs (TS/Python/Go/C#) when running in a fork.
.github/workflows/corrections-tests.yml Skip corrections tests job when running in a fork.
.github/workflows/copilot-setup-steps.yml Skip Copilot setup-steps job when running in a fork.
.github/workflows/codegen-check.yml Skip codegen up-to-date check job when running in a fork.

Copy link
Copy Markdown
Collaborator

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Thanks

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.

3 participants