From 7f9d2e559697e9d9d1f6df3514c8269612e7bcee Mon Sep 17 00:00:00 2001
From: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
Date: Wed, 9 Feb 2022 16:42:25 +0100
Subject: [PATCH] Only check changed wdl files

---
 .github/workflows/lint.yml | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index d2ea7df..93e86da 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -58,30 +58,33 @@ jobs:
       - name: Update test environment
         run: mamba env update -n biowdl-lint -f .github/lint-environment.yml
         if: steps.env_cache.outputs.cache-hit != 'true'
+      
+      - name: Fetch develop branch for comparisons
+        run: git fetch --depth=1 origin develop
 
       - name: run womtool validate
         # Only check files that have changed from the base reference.
         # Womtool validate checks very slowly, so this saves a lot of time.
         run: |
           bash -c '
-            git fetch --depth=1 origin develop
-            for WDL_FILE in $(git diff --name-only origin/${{github.base_ref}} | grep -E '*.wdl$'); do
+            for WDL_FILE in $(git diff --name-only origin/${{github.base_ref}} | grep -E \'*.wdl$\'); do
               womtool validate $WDL_FILE
             done
           '
       - name: run miniwdl check
         run: bash -c 'miniwdl check $(git ls-files *.wdl)'
+
       - name: Check copyright headers
         run: | 
           bash -c '
-            for WDL_FILE in $(git ls-files *.wdl); do
+            for WDL_FILE in $(git diff --name-only origin/${{github.base_ref}} | grep -E \'*.wdl$\'); do
               grep Copyright $WDL_FILE || bash -c "echo No copyright header in $WDL_FILE && exit 1"
             done
           '
       - name: Check parameter_meta for inputs
         run: |
           bash -c '
-            for WDL_FILE in $(git ls-files *.wdl); do
+            for WDL_FILE in $(git diff --name-only origin/${{github.base_ref}} | grep -E \'*.wdl$\'); do
               wdl-aid --strict $WDL_FILE > /dev/null 2> wdl-aid_stderr || 
               if grep -z  "ValueError: Missing parameter_meta for inputs:" wdl-aid_stderr
               then
-- 
GitLab