Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw an error when activating a theme or plugin that doesn't exist #1391

Merged
merged 12 commits into from
May 16, 2024
Prev Previous commit
Next Next commit
GitHub export: Create new commits in your fork when writing to the up…
…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 committed May 14, 2024
commit 6913e345959a888a778da44b56f9a48478bbd29f
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
Loading