From 8f03948e32e246dae3cbd683428ffc2be9b11ee1 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 30 Jun 2023 10:14:32 +0100 Subject: [PATCH] Improve screenshot action error handling If the gradle build fails for some reason, the script should bail out instead of carrying on and pushing a commit that deletes all the screenshots[1]! `set -e` simply makes the script return the appropriate exit code immediately if any of the subcommands fails. [1] e.g. https://github.com/vector-im/element-x-android/pull/726/commits/529a7c87ef94fdfa77006a82885418b799003407 --- .github/workflows/scripts/recordScreenshots.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/scripts/recordScreenshots.sh b/.github/workflows/scripts/recordScreenshots.sh index 2cfec13818..028e480a5b 100755 --- a/.github/workflows/scripts/recordScreenshots.sh +++ b/.github/workflows/scripts/recordScreenshots.sh @@ -16,6 +16,8 @@ # limitations under the License. # +set -e + TOKEN=$GITHUB_TOKEN REPO=$GITHUB_REPOSITORY