Skip to content

Commit 85b203c

Browse files
authored
Fix/open pr update screenshots (#851)
* fix: open PR before updating screenshots * fix: create PR to update the screenshots
1 parent d73a528 commit 85b203c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/run-tests-example-apps.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515

1616
permissions:
1717
contents: write
18+
pull-requests: write
1819

1920
jobs:
2021
run-tests-example-apps:
@@ -52,6 +53,19 @@ jobs:
5253
run: |
5354
git config --global user.name "github-actions[bot]"
5455
git config --global user.email "github-actions[bot]@users.noreply.github.com"
56+
57+
# Create a branch and open a PR (unique branch name based on run id)
58+
BRANCH="update-screenshots-${{ github.run_id }}"
59+
git checkout -b "$BRANCH"
5560
git add .
5661
git commit -m 'ci: update screenshots' --allow-empty
57-
git push
62+
63+
# Push changes
64+
git push origin "$BRANCH"
65+
66+
# Open PR
67+
gh pr create \
68+
--base main \
69+
--head "$BRANCH" \
70+
--title "ci: update screenshots" \
71+
--body "Automated update of visual test screenshots from GitHub Actions workflow."

0 commit comments

Comments
 (0)