WordPress / wordpress-playground

Run WordPress in the browser via WebAssembly PHP
https://w.org/playground/
GNU General Public License v2.0
1.64k stars 258 forks source link

"Create a new PR" doesn't target the correct specified GitHub repo #1575

Open beafialho opened 4 months ago

beafialho commented 4 months ago

When I create a new PR to add a new theme to the repo, I would expect it to end up on https://github.com/Automattic/themes/, but the PR is opened from a fork of this repo https://github.com/beafialho/themes instead.

More context

Captura de ecrã 2024-07-05, às 09 20 44

brandonpayton commented 4 months ago

Based on permissions, it looks like this should be working for @beafialho, but perhaps we are encountering an error and pushing to a fork as a fallback here: https://github.com/WordPress/wordpress-playground/blob/a7004a574444ca555394fbb0b3a90eb74d190c52/packages/playground/website/src/github/github-export-form/form.tsx#L933-L942

adamziel commented 3 months ago

GitHub permissions are weird. Sometimes you are a repo admin, but the organization restricted what you can do via different types of auth tokens – like the OAuth token we use here. Assuming organization restrictions are the problem here, here's what would help:

adamziel commented 3 months ago

Since this issue is a blocker for GitHub automations leaving comments with PR preview links in the Automattic/themes repo (since the pull_request: trigger won't run for forks), I left this comment and added the other issue to the board:

@mikachan would there be anything wrong with using the pull_request_target: trigger instead of pull_request: in the preview-theme.yml workflow? This would make it work for PRs from forks.