Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions packages/playground/website/src/github/preview-pr/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@ interface PreviewPRFormProps {

const urlParams = new URLSearchParams(window.location.search);

// This structure is from plugin-proxy.php
// where we set allowed inputs for WordPress and Gutenberg repositories
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice comment!

export const targetParams = {
wordpress: {
repo: 'wordpress-develop',
workflow: 'Test%20Build%20Processes',
artifact: 'wordpress-build-',
pull: 'github.com/wordpress/wordpress-develop/pull'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to think of a more descriptive name, such as baseUrl, but there's no https:// here which makes it more difficult. Let's go with pull for now.

},
gutenberg: {
repo: 'gutenberg',
workflow: 'Build%20Gutenberg%20Plugin%20Zip',
artifact: 'gutenberg-plugin',
pull: 'github.com/wordpress/gutenberg/pull'
},
};

Expand Down Expand Up @@ -73,10 +77,7 @@ export default function PreviewPRForm({
if (
prNumber
.toLowerCase()
.includes('github.com/wordpress/wordpress-develop/pull') ||
prNumber
.toLowerCase()
.includes('github.com/wordpress/gutenberg/pull')
.includes(targetParams[target].pull)
) {
prNumber = prNumber.match(/\/pull\/(\d+)/)![1];
}
Expand Down
Loading