Add details to the automated content update PR #467
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was aiming to add screenshots & other context to the content update PRs (e.g., #464), as I've found myself needing to reply with comments describing the changes and/or linking off to relevant issues (when these exist, this is easier 🙂)
This PR is adds a changed-page list & link to screenshots to the automatically-created PR. The screenshots are added as a link to the action's artifacts file, which is a zip file with full-screen screenshots of the changed pages. Changed pages are detected by updates to the pattern files, which are looked up using the
manifest.json
to get the page slug. The slug is then used to fetch page data from the wp.org REST API, which is how we get the title & permalink.If there are multiple pages changed, they should all appear in the list, and all screenshots will be in the download.
(Note that this won't work with the 6.6 release page, since the pattern is currently set to the "in progress" pattern #463, it will only show the placeholder pattern.)
Screenshots
ryelle#1
How to test the changes in this Pull Request:
I tested it on my own fork, changing the action to
if: github.repository_owner == 'ryelle'
, & making a change to one of the pattern files. That way, when the automated action runs, it sees the "change" and creates a PR.You can also test the screenshot command by running
yarn screenshot-changes source/wp-content/themes/wporg-main-2022/patterns/about.php
(or any other pattern files). Make sure to runyarn
first to get the new puppeteer dependency.