Skip to content

Conversation

@lars20070
Copy link

@lars20070 lars20070 commented Nov 10, 2025

Problem

The CI pipeline currently requires a number of secrets in order to run on GitHub.
Because forks don’t have access to those secrets, the CI pipeline fails when run on a fork.

Solution

Disable the parts of the CI pipeline that require secrets when the repository is not pydantic/pydantic-ai.

Changes

  • Added two conditionals in ci.yml to bypass secret-dependent jobs when the repository is a fork.
  • Updated .gitignore to ignore the Cursor config and the dev container in the project root.

@lars20070 lars20070 marked this pull request as ready for review November 10, 2025 13:22
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push'
if: (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push') && github.repository == 'pydantic/pydantic-ai'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this be simplified? I don't know if we still need the github.event.pull_request.head.repo.full_name == github.repository check was was presumably meant to accomplish something similar.

Copy link
Author

@lars20070 lars20070 Nov 11, 2025

Choose a reason for hiding this comment

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

TLDR, I cannot see a simplification. github.event.pull_request.head.repo.full_name == github.repository checks that the PR is from a branch within the base repository (not from a fork).

(1) True when you push a feature branch to your main.
(2) Also true when I push a feature branch from my fork to main in my fork. Say if I want to experiment and not want to clutter your "PR inbox" with my drafts.
(3) False if I push a feature branch from my fork to your main.

The most important use case (3) is covered by the existing code. My new conditional covers (2), and is orthogonal. We cannot remove github.event.pull_request.head.repo.full_name == github.repository.

Alternatively, I can check for the existence of every secret instead, for example secrets.PPPR_TOKEN != ''. But if you introduce a new secret, the code breaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants