Skip to content

Commit

Permalink
Add option to specify pr number for export via query params (#1465)
Browse files Browse the repository at this point in the history
## What is this PR doing?

It extends the options to pre-configure GH export via provided link so
that PR number can also be specified.

## What problem is it solving?

The need occurred when updating playground link script in this
repository:
WordPress/community-themes#185

It's especially beneficial in such GH actions, or when working with
non-developers that are contributing to themes.

## How is the problem addressed?

It just extends existing logic by adding a next query param check.

## Testing Instructions

Due to limitations (GH authorization not supporting local endpoints)
it's not possible to easily test this change. In general, opening:

https://playground.wordpress.net/?ghexport-repo-url=https://github.com/WordPress/wordpress-playgrounds&ghexport-content-type=theme&ghexport-theme=twentytwentyfour&ghexport-pr-action=update&ghexport-pr-number=999&state=github-export

Should end up with Github Export form having PR number pre-filled:
![CleanShot 2024-05-27 at 19 31
44@2x](https://github.com/WordPress/wordpress-playground/assets/8419292/c5bc466e-a926-471b-84cb-63832b094807)
  • Loading branch information
robertsreberski authored May 28, 2024
1 parent aeb32b1 commit eef41af
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/playground/website/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ function Main() {
query.get('ghexport-pr-action')
);
}
if (query.get('ghexport-pr-number')) {
values.prNumber = query.get('ghexport-pr-number')?.toString();
}
if (query.get('ghexport-playground-root')) {
values.fromPlaygroundRoot = query.get('ghexport-playground-root')!;
}
Expand Down

0 comments on commit eef41af

Please sign in to comment.