-
Fetch latest main
git fetch origin main
-
Create a timestamped branch from origin/main
Format: regen-screenshots/YYYY-MM-DDTHH (hour resolution, local time)
git checkout -b regen-screenshots/<datetime> origin/main
-
Create an empty commit
git commit --allow-empty -m "test: regenerate screenshot expectations"
-
Push the branch
git push origin regen-screenshots/<datetime>
-
Generate a poem about regenerating screenshots. Be creative — a
new, unique poem every time. Short (4–8 lines). Can be funny, wistful,
epic, haiku-style, limerick, sonnet fragment — vary the form.
-
Create the PR with the poem as the body (no label yet).
Write the poem to a temp file and use --body-file:
gh pr create \
--base main \
--head regen-screenshots/<datetime> \
--title "test: regenerate screenshot expectations" \
--body-file <temp-file>
-
Add the label as a separate step to trigger the GitHub Action.
The labeled event only fires when a label is added after PR
creation, not when applied during creation via --label.
Use the GitHub API directly (gh pr edit --add-label fails due to
deprecated Projects Classic GraphQL errors):
gh api repos/{owner}/{repo}/issues/<pr-number>/labels \
-f "labels[]=New Browser Test Expectations" --method POST
-
Report the result to the user:
- PR URL
- Branch name
- Note that the GitHub Action will run automatically and commit
updated screenshots to the branch.