Skip to content

Commit

Permalink
GitHub export: Create new commits in your fork when writing to the up…
Browse files Browse the repository at this point in the history
…stream 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 #1367
  • Loading branch information
adamziel authored May 14, 2024
1 parent 0b05edf commit 6913e34
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ async function pushToGithub(
>['data'];
if (shouldCreateNewPR) {
const { data: branch } = await octokit.rest.repos.getBranch({
owner,
owner: pushToOwner,
repo,
branch: againstBranch,
});
Expand Down

0 comments on commit 6913e34

Please sign in to comment.