diff --git a/.github/workflows/run-tests-example-apps.yml b/.github/workflows/run-tests-example-apps.yml index 9584b8b58..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,6 +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 - git push \ No newline at end of file + + # Push changes + git push origin "$BRANCH" + + # Open PR + gh pr create \ + --base main \ + --head "$BRANCH" \ + --title "ci: update screenshots" \ + --body "Automated update of visual test screenshots from GitHub Actions workflow." \ No newline at end of file