Skip to content

Commit 1d8f583

Browse files
committed
chore: Fix changed_files matrix calculation
1 parent 62b3687 commit 1d8f583

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/acc-test.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,14 @@ jobs:
5252
import re
5353
from pathlib import Path
5454
55-
files = [f.strip().lstrip('./') for f in os.environ.get('CHANGED_FILES', '').splitlines() if f.strip()]
55+
files = []
56+
for f in os.environ.get('CHANGED_FILES', '').splitlines():
57+
f = f.strip()
58+
if not f:
59+
continue
60+
if f.startswith('./'):
61+
f = f[2:]
62+
files.append(f)
5663
5764
def snake_to_camel(s: str) -> str:
5865
return ''.join(part[:1].upper() + part[1:] for part in s.split('_') if part)
@@ -84,8 +91,13 @@ jobs:
8491
return 'TestAccDocker' + snake_to_camel(base)
8592
8693
go_mod_changed = any(f in {'go.mod', 'go.sum'} for f in files)
94+
workflow_changed = any(
95+
f.startswith('.github/workflows/') or f.startswith('github/workflows/')
96+
for f in files
97+
)
8798
go_files = [f for f in files if f.endswith('.go')]
88-
if not go_files and not go_mod_changed:
99+
100+
if not go_files and not go_mod_changed and not workflow_changed:
89101
should_run = False
90102
selected = []
91103
else:
@@ -122,7 +134,7 @@ jobs:
122134
'TestAccDockerVolume',
123135
]
124136
125-
if other_go_change or go_mod_changed:
137+
if workflow_changed or other_go_change or go_mod_changed:
126138
selected = full_matrix_prefixes
127139
should_run = True
128140
else:

0 commit comments

Comments
 (0)