Configure CI for PR from forked repo

Open
#56 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
github-actions
Domain
ci-cd, security

Research direction

Start with the failed GitHub Actions run linked in the issue and inspect the workflow used by PR #55. Check the fork-PR event and permission settings against the documented pull_request_target approach, then verify that the workflow can comment on fork PRs without executing untrusted fork code with elevated permissions.

Written by the indexing model from the issue text.

Description

Ref: #55

https://github.com/OpenAPITools/openapi-generator-pip/actions/runs/25132610526/job/73662970317?pr=55#step:7:48

This PR is from a fork. GitHub restricts the GITHUB_TOKEN to read-only
for fork PRs triggered by the pull_request event.

To fix this, use the pull_request_target event instead:

on:
  pull_request_target:
    types: [opened, synchronize, reopened]

permissions:
  contents: read
  pull-requests: write

Note: pull_request_target runs in the context of the base branch.
Be cautious when checking out fork code — never run untrusted code
from the fork with elevated permissions.

For more information, see:
https://github.com/MishaKav/pytest-coverage-comment#fork-prs

Dominant language
Python
Stars
31
Forks
9
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenAPITools/openapi-generator-pip

All issues in OpenAPITools/openapi-generator-pip

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.