summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2022-05-10 22:29:20 +0300
committerNeroBurner <pyro4hell@gmail.com>2022-05-16 23:25:47 +0200
commita6fcdec0f8157fb65e52712255295ebe78c455af (patch)
treeec343f41f6e8937c156f7410d66c3a51c84a2832 /tests
parent443408312a0fd6e22bef6ffc878155479ba9eb53 (diff)
Don't allow test-format.sh to be run locally
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test-format.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/test-format.sh b/tests/test-format.sh
index 7196e260..1dd9cdbd 100755
--- a/tests/test-format.sh
+++ b/tests/test-format.sh
@@ -2,11 +2,13 @@
set -e
-[ -z "$1" ] && exit
-
-basebranch=$1
+if [ -z "$GITHUB_BASE_REF" ]
+then
+ echo "This script is only meant to be run in a GitHub Workflow"
+ exit 1
+fi
-CHANGED_FILES=$(git diff --name-only "$basebranch"...HEAD)
+CHANGED_FILES=$(git diff --name-only "$GITHUB_BASE_REF"...HEAD)
CHANGED=0