From e1a6bd688fae12b8512f7d42cff468bfd45c57de Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Thu, 7 Jul 2022 13:33:27 +0200 Subject: [PATCH] MOBILE-4110 ci: Fix behat plugin diff calculation --- .github/scripts/functions.sh | 9 +++++++-- .github/scripts/update_behat_plugin.sh | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/scripts/functions.sh b/.github/scripts/functions.sh index 33ee4febb..7aac611c7 100644 --- a/.github/scripts/functions.sh +++ b/.github/scripts/functions.sh @@ -65,10 +65,15 @@ function notify_on_error_exit { } function get_behat_plugin_changes_diff { - i=0 - previoushash="" + # Grab hashes from app repository currenthash=`git rev-parse HEAD` initialhash=`git rev-list HEAD | tail -n 1` + + # Move into plugin repository to find previous hash + cd tmp/local_moodleappbehat + + i=0 + previoushash="" totalcommits=`git log --oneline | wc -l` repositoryname=`echo $GITHUB_REPOSITORY | sed "s/\\//\\\\\\\\\\//"` diff --git a/.github/scripts/update_behat_plugin.sh b/.github/scripts/update_behat_plugin.sh index 5419d831a..3783a3699 100755 --- a/.github/scripts/update_behat_plugin.sh +++ b/.github/scripts/update_behat_plugin.sh @@ -47,10 +47,10 @@ sed -i s/\$plugin-\>version\ =\ [0-9]\\+\;/\$plugin-\>version\ =\ $newpluginvers # Apply new changes print_title "Applying changes to repository..." -cd tmp/local_moodleappbehat - diff=`get_behat_plugin_changes_diff` +cd tmp/local_moodleappbehat + # Set up Github Actions bot user # See https://github.community/t/github-actions-bot-email-address/17204/6 git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"