From 979ad310010197fd2ae6bd8ce066c878b274a5bc Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Thu, 13 Jun 2024 16:46:11 -0600 Subject: [PATCH] github actions: Add check for bad extensions Adds a check that will reject files with the wrong extension --- .github/workflows/pull_request.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 43a9474..3c1f130 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -16,9 +16,23 @@ jobs: -not -path './tools-java/*' \ -not -path '*/spdx2.2/*' \ -not -path '*/spdx2.3/*' \ - -not -path '*/spdx-3.0/*' | tee flist.txt + -not -path '*/spdx-3.0/*' > flist.txt - test "$(cat flist.txt | wc -l)" = "0" + if [ "$(cat flist.txt | wc -l)" != "0" ]; then + echo "The following files are in the wrong location and will not be checked:" + cat flist.txt + exit 1 + fi + + - name: Look for files with the wrong extension + run: | + find . -name '*.jsonld' > flist.txt + + if [ "$(cat flist.txt | wc -l)" != "0" ]; then + echo "The following files have the wrong extension and will not be checked:" + cat flist.txt + exit 1 + fi - name: Update apt run: |