From 32523a662f2e9f2f718e5cd1a45574d8db8b5468 Mon Sep 17 00:00:00 2001 From: Gabriel Chittolina Date: Tue, 2 Sep 2025 16:09:38 -0300 Subject: [PATCH 1/2] fix: open PR before updating screenshots --- .github/workflows/run-tests-example-apps.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests-example-apps.yml b/.github/workflows/run-tests-example-apps.yml index 9584b8b58..bfb54e3f4 100644 --- a/.github/workflows/run-tests-example-apps.yml +++ b/.github/workflows/run-tests-example-apps.yml @@ -52,6 +52,16 @@ jobs: run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" + # Create a branch and open a PR (unique branch name based on run id) + BRANCH="update-screenshots-${{ github.run_id }}" + git checkout -b "$BRANCH" + # Open PR + gh pr create \ + --base main \ + --head "$BRANCH" \ + --title "ci: update screenshots" \ + --body "Update screenshots" + git add . git commit -m 'ci: update screenshots' --allow-empty - git push \ No newline at end of file + git push origin "$BRANCH" \ No newline at end of file From 538b31881c8d9c71b138a7647ff930bd99ae5f0e Mon Sep 17 00:00:00 2001 From: Gabriel Chittolina Date: Tue, 2 Sep 2025 16:17:18 -0300 Subject: [PATCH 2/2] fix: create PR to update the screenshots --- .github/workflows/run-tests-example-apps.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run-tests-example-apps.yml b/.github/workflows/run-tests-example-apps.yml index bfb54e3f4..4e5dcdcc7 100644 --- a/.github/workflows/run-tests-example-apps.yml +++ b/.github/workflows/run-tests-example-apps.yml @@ -15,6 +15,7 @@ on: permissions: contents: write + pull-requests: write jobs: run-tests-example-apps: @@ -52,16 +53,19 @@ jobs: run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" + # Create a branch and open a PR (unique branch name based on run id) BRANCH="update-screenshots-${{ github.run_id }}" git checkout -b "$BRANCH" + git add . + git commit -m 'ci: update screenshots' --allow-empty + + # Push changes + git push origin "$BRANCH" + # Open PR gh pr create \ --base main \ --head "$BRANCH" \ --title "ci: update screenshots" \ - --body "Update screenshots" - - git add . - git commit -m 'ci: update screenshots' --allow-empty - git push origin "$BRANCH" \ No newline at end of file + --body "Automated update of visual test screenshots from GitHub Actions workflow." \ No newline at end of file