From 6913e345959a888a778da44b56f9a48478bbd29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Tue, 14 May 2024 15:19:03 +0200 Subject: [PATCH] GitHub export: Create new commits in your fork when writing to the upstream repo isn't allowed (#1392) When the GitHub export flow used a forked repository, it would still attempt to create a branch in the upstream repository. This resulted in the following cryptic error: > There was an unexpected error (Not Found), please try again. If the > problem persists, please report it at https://github.com/WordPress/ > wordpress-playground/issues. This PR ensures that branch is created in the push target ## Testing instructions 1. Import an `upsidedown` theme from https://github.com/Automattic/themes 2. Run `await playground.writeFile('/wordpress/wp-content/themes/upsidedown/test.txt', 'test');` in devtools 3. Try to export the changes as a PR, confirm a PR got created Closes https://github.com/WordPress/wordpress-playground/issues/1367 --- .../playground/website/src/github/github-export-form/form.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playground/website/src/github/github-export-form/form.tsx b/packages/playground/website/src/github/github-export-form/form.tsx index 6542a9958a..f0619e1ccc 100644 --- a/packages/playground/website/src/github/github-export-form/form.tsx +++ b/packages/playground/website/src/github/github-export-form/form.tsx @@ -861,7 +861,7 @@ async function pushToGithub( >['data']; if (shouldCreateNewPR) { const { data: branch } = await octokit.rest.repos.getBranch({ - owner, + owner: pushToOwner, repo, branch: againstBranch, });