File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -182,23 +182,23 @@ jobs:
182182 java-version : ' 25'
183183
184184 - name : Check for modified files and test presence
185- id : code-check
186- run : |
187- # Ensure full history
188- git fetch origin main
189- git checkout ${{ github.ref_name }}
190- git branch --set-upstream-to=origin/main ${{ github.ref_name }}
191-
192- # Check for test files
193- has_tests=$(find src/test/java -type f -name "*.java" | grep -q . && echo "true" || echo "false")
194-
195- # Check for modified files
196- changed_files=$(git diff --name-only origin/main...HEAD | grep -E '^src/(main|test)/java/.*\.java$' || true)
197- has_changes=$(test -n "$changed_files" && echo "true" || echo "false")
198-
199- echo "has_tests=$has_tests" >> $GITHUB_OUTPUT
200- echo "has_changes=$has_changes" >> $GITHUB_OUTPUT
201- echo "should_grade=$([[ $has_tests == 'true' && $has_changes == 'true' ]] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
185+ id : code-check
186+ run : |
187+ # Ensure full history
188+ git fetch origin main
189+ git checkout "${GITHUB_REF##*/}"
190+ git branch --set-upstream-to=origin/main "${GITHUB_REF##*/}"
191+
192+ # Check for test files
193+ has_tests=$(find src/test/java -type f -name "*.java" | grep -q . && echo "true" || echo "false")
194+
195+ # Check for modified files
196+ changed_files=$(git diff --name-only origin/main...HEAD | grep -E '^src/(main|test)/java/.*\.java$' || true)
197+ has_changes=$(test -n "$changed_files" && echo "true" || echo "false")
198+
199+ echo "has_tests=$has_tests" >> $GITHUB_OUTPUT
200+ echo "has_changes=$has_changes" >> $GITHUB_OUTPUT
201+ echo "should_grade=$([[ $has_tests == 'true' && $has_changes == 'true' ]] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
202202
203203 - name : Compilation Check
204204 id : compilation-check
You can’t perform that action at this time.
0 commit comments