feat: fixed commitlint check in github actions #2868
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixed a bug in the commitlint check in github actions. The variable github.event_name was missing the ${{ }} around them to make it a proper string comparison.
Another check has the same problem and therefore never run as well. I deleted the other check, because @yaugenst and I believe that this check is superficial anyways (in the past it definitely never ran because of this bug).
related to #2862.
Greptile Overview
Updated On: 2025-10-07 06:39:35 UTC
Summary
This PR fixes a critical bug in the GitHub Actions workflow for the Tidy3D Python client where commit message linting was never actually executing due to incorrect template syntax. The main issue was that `github.event_name` variables were used as bare strings instead of being properly wrapped in `${{ }}` brackets, causing string comparisons to always evaluate as false.The changes update the workflow to properly check if the event is a merge_group before running commit message validation, rename a job for consistency (
check-commit-messages→lint-commit-messages), remove a problematic approval check that was preventing execution, and add debugging output to provide visibility into workflow operation. This ensures that commit message linting now runs as intended during merge group events, aligning with the established pattern of validating commits before merges while avoiding disruption during regular PR development.The fix addresses a longstanding issue where the commit linting functionality existed in the codebase but was silently failing, which could have led to inconsistent commit message standards over time.
Important Files Changed
Changed Files
Confidence score: 4/5
Sequence Diagram
sequenceDiagram participant User participant GitHub participant DetermineScope as "determine-test-scope" participant Approval as "PR Approval Check" participant Lint as "lint" participant CommitLint as "lint-commit-messages" participant SchemaVerify as "verify-schema-change" participant LocalTests as "local-tests" participant RemoteTests as "remote-tests" participant PRRequirements as "pr-requirements-pass" User->>GitHub: "Creates/Updates Pull Request" GitHub->>DetermineScope: "Trigger workflow" alt Pull Request Event DetermineScope->>Approval: "Check PR approval status" Approval->>DetermineScope: "Return approval state" end DetermineScope->>DetermineScope: "Determine test scope based on event/approval" DetermineScope->>GitHub: "Output local_tests and remote_tests flags" par Conditional Job Execution alt Local or Remote Tests Required GitHub->>Lint: "Run linting checks" Lint->>Lint: "Run ruff format and check" Lint->>GitHub: "Return lint results" end alt Merge Group Event GitHub->>CommitLint: "Check commit messages" CommitLint->>CommitLint: "Validate conventional commits format" CommitLint->>GitHub: "Return commit lint results" end alt Local or Remote Tests Required GitHub->>SchemaVerify: "Verify schema changes" SchemaVerify->>SchemaVerify: "Check schema consistency and versioning" SchemaVerify->>GitHub: "Return schema verification results" end alt Local Tests Required GitHub->>LocalTests: "Run local tests" LocalTests->>LocalTests: "Execute test suite with coverage" LocalTests->>GitHub: "Return local test results and coverage" end alt Remote Tests Required GitHub->>RemoteTests: "Run remote tests" RemoteTests->>RemoteTests: "Execute tests across multiple platforms/versions" RemoteTests->>GitHub: "Return remote test results" end end GitHub->>PRRequirements: "Aggregate all job results" PRRequirements->>PRRequirements: "Validate all required jobs passed" PRRequirements->>GitHub: "Final PR status" GitHub->>User: "Workflow completion status"