Skip to content

Commit cd6fec2

Browse files
committed
fix: do not return debug fields in GitHub Actions matrix output
1 parent 094736d commit cd6fec2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

scripts/github-matrix.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,16 @@ def main() -> None:
207207
list(run_nix_eval_jobs(cmd, flake_output))
208208
)
209209

210+
def clean_package_for_output(pkg: GitHubActionPackage) -> dict:
211+
"""Remove debug fields from package for final output"""
212+
return {
213+
"attr": pkg["attr"],
214+
"name": pkg["name"],
215+
"system": pkg["system"],
216+
"runs_on": pkg["runs_on"],
217+
**({ "postgresql_version": pkg["postgresql_version"]} if "postgresql_version" in pkg else {})
218+
}
219+
210220
if args.target == "extensions":
211221
# filter to only include extension packages and add postgresql_version field
212222
gh_action_packages = [
@@ -218,14 +228,15 @@ def main() -> None:
218228
# Group packages by system
219229
grouped_by_system = defaultdict(list)
220230
for pkg in gh_action_packages:
221-
grouped_by_system[pkg["system"]].append(pkg)
231+
grouped_by_system[pkg["system"]].append(clean_package_for_output(pkg))
222232

223233
# Create output with system-specific matrices
224234
gh_output = {}
225235
for system, packages in grouped_by_system.items():
226236
gh_output[system.replace("-", "_")] = {"include": packages}
227237
else:
228-
gh_output = {"include": gh_action_packages}
238+
cleaned_packages = [clean_package_for_output(pkg) for pkg in gh_action_packages]
239+
gh_output = {"include": cleaned_packages}
229240

230241
print(json.dumps(gh_output))
231242

0 commit comments

Comments
 (0)