Skip to content

secure CI for fork and trusted pull requests - #39

Merged
rahulbshrestha merged 1 commit into
causalNLP:mainfrom
erivaninan:fix-pr-ci
Sep 24, 2026
Merged

rahulbshrestha merged 1 commit into
causalNLP:mainfrom
erivaninan:fix-pr-ci

Conversation

@erivaninan

Copy link
Copy Markdown
Contributor

This PR updates the test workflow to handle fork and trusted pull requests separately.

  • Fork pull requests run the test suite without repository secrets.
  • Same-repository pull requests and trusted events retain access to OPENAI_API_KEY through the protected causal-agent environment.
  • The workflow now uses pull_request instead of pull_request_target.
  • actions/checkout is updated from v3 to v4.
  • The workflow token is explicitly restricted to read-only repository access.

The previous workflow used pull_request_target, checked out code from a fork, and executed it with access to repository secrets. GitHub now blocks this pattern because it can lead to a "pwn request" vulnerability.

The new workflow preserves regular unit testing for fork contributions while keeping API-backed tests available only in trusted contexts. (This PR should be merged before PR#36 so that its pytest workflow can run safely.)

@rahulbshrestha
rahulbshrestha merged commit 15bc2b3 into causalNLP:main Sep 24, 2026
0 of 2 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