Skip to content

Commit 7cad07a

Browse files
Streamline check_for_changes logic
1 parent caacdae commit 7cad07a

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

.github/workflows/test_controller.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ on:
55
push:
66

77
jobs:
8+
# This job checks if there are any changes to important code files. Specifically
9+
# - Code/**
10+
# - tests/**
11+
# - .github/**
12+
# If there are any changes, the job will set the run_full_tests output to true.
13+
# If there are no changes, the job will set the run_full_tests output to false.
814
check_for_changes:
915
runs-on: ubuntu-latest
1016
outputs:
@@ -15,22 +21,18 @@ jobs:
1521
id: filter
1622
with:
1723
filters: |
18-
code:
24+
relevant:
1925
- 'Code/**'
20-
tests:
2126
- 'tests/**'
22-
- name: Set consolidated outputs
27+
- '.github/**'
28+
- name: Set output
2329
id: set-outputs
24-
env:
25-
CODE: ${{ steps.filter.outputs.code || 'false' }}
26-
TESTS: ${{ steps.filter.outputs.tests || 'false' }}
2730
run: |
28-
if [ "${CODE}" = "true" ] || [ "${TESTS}" = "true" ]; then
29-
RUN_FULL_TESTS=true
31+
if [ "${{ steps.filter.outputs.relevant }}" = "true" ]; then
32+
echo "run_full_tests=true" >> "$GITHUB_OUTPUT"
3033
else
31-
RUN_FULL_TESTS=false
34+
echo "run_full_tests=false" >> "$GITHUB_OUTPUT"
3235
fi
33-
echo "run_full_tests=${RUN_FULL_TESTS}" >> "$GITHUB_OUTPUT"
3436
3537
# Dummy job that always passes when no code/tests changed
3638
test:

0 commit comments

Comments
 (0)