Skip to content

Improve error message when screenshot tests fail due to being on a fork. #1756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/Build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,18 @@ jobs:
continue-on-error: true
run: ./gradlew verifyRoborazziDemoDebug

# If this is a fork, we don't have the authority to push screenshots to that fork. It would
# also be a security risk for our CI to run commands on an untrusted codebase.
# It is up to the fork owner to generate new screenshots.
- name: Prevent pushing new screenshots if this is a fork
id: checkfork_screenshots
continue-on-error: false
if: steps.screenshotsverify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
run: |
echo "::error::Screenshot tests failed, please create a PR in your fork first."
echo "Your fork's CI will take screenshots for your fork."
echo "::error::Screenshot tests failed and we cannot generate new screenshots"
echo " automatically because this is a fork."
echo "Generate new screenshots by enabling Github Actions on the fork and running the"
echo " Build.yaml workflow on it."
exit 1

# Runs if previous job failed
Expand Down
Loading