From 30044a72a92174dc9155dc5a7b2f17cacc6a4204 Mon Sep 17 00:00:00 2001 From: Dominikus Nold Date: Tue, 31 Mar 2026 01:23:50 +0200 Subject: [PATCH] fix: assert hook id stability and cd to repo root for local actionlint - Assert hook id == "specfact-smart-checks" to prevent silent renames - cd to REPO_ROOT before running local actionlint so it finds workflows regardless of caller's cwd Co-Authored-By: Claude Opus 4.6 --- scripts/run_actionlint.sh | 1 + tests/unit/workflows/test_trustworthy_green_checks.py | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/run_actionlint.sh b/scripts/run_actionlint.sh index 0954a969..3be25e05 100755 --- a/scripts/run_actionlint.sh +++ b/scripts/run_actionlint.sh @@ -20,6 +20,7 @@ has_docker() { } if has_actionlint; then + cd "$REPO_ROOT" actionlint -no-color exit $? fi diff --git a/tests/unit/workflows/test_trustworthy_green_checks.py b/tests/unit/workflows/test_trustworthy_green_checks.py index 527fc90b..1d44eeec 100644 --- a/tests/unit/workflows/test_trustworthy_green_checks.py +++ b/tests/unit/workflows/test_trustworthy_green_checks.py @@ -171,6 +171,7 @@ def test_pre_commit_config_installs_supported_smart_check_wrapper() -> None: matching = [hook for hook in hooks if hook.get("entry") == "scripts/pre-commit-smart-checks.sh"] assert matching, "Expected .pre-commit-config.yaml to expose the smart-check wrapper hook" hook = matching[0] + assert hook.get("id") == "specfact-smart-checks", "Hook id must remain stable for pre-commit consumers" assert hook.get("pass_filenames") is False assert hook.get("language") == "script"