Skip to content

Regression in @5.0.21: rules: input cannot find user checker file (Cannot find module ...) #2962

Description

@Yaminyam

Summary

Starting with @graphql-inspector/[email protected] (release-1781692943029, 2026-06-17), the rules: input can no longer load a user-defined checker file from the checked-out workspace. Every run dies before doing anything useful with:

Cannot find module '/home/runner/work/<repo>/<repo>/gql-inspector-checker.js'

The same workflow pinned to release-1717403590269 (the last kamilkisiela/graphql-inspector tag, [email protected]) works fine with the ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true Node 20 opt-in.

Reproduction

Minimal workflow (the one we run on every PR in lablup/backend.ai):

graphql-inspector:
  runs-on: ubuntu-latest
  permissions:
    contents: read
    pull-requests: write
    checks: write
  steps:
    - uses: actions/checkout@v6
    - uses: graphql-hive/graphql-inspector@release-1781692943029
      with:
        schema: '${{ github.base_ref }}:docs/manager/graphql-reference/schema.graphql'
        rules: |
          gql-inspector-checker.js

gql-inspector-checker.js is at the repository root (CommonJS, module.exports = (props) => ...). It exists in main, in the PR head, and git ls-tree confirms the blob is present. The actions/checkout@v6 step completes successfully, but the action step fails as above.

Two failed mitigation attempts:

  1. Anchor the path to the workspace explicitly:

    rules: |
      ${{ github.workspace }}/gql-inspector-checker.js

    → same error (the resolved absolute path appears in the error, but the action still cannot find it).

  2. Disable the experimental merge so workspace stays defined:

    experimental_merge: false

    → same error.

Failing runs on a public branch: lablup/backend.ai#12291 (commits f2c0ce6, 61f5766).

What I think changed

@graphql-inspector/[email protected] (release-1762976032309, 2025-11) bumped @graphql-inspector/commands to 6.0.0 via #2893, whose changelog says “Paths also needed changed to consistently and uniquely map to the node being changed.” That diff was about schema change path fields, not file-system paths — but it looks like the same release also altered (regressed) how resolveRule / ensureAbsolute locate the rules file.

Public release notes for 5.0.12 → 5.0.21 only document the Node 24 runtime fix (#2957) and dependency bumps; no mention of an intentional rules: semantics change.

Why this matters

External usage of rules: is rare (a code search of .github/workflows/*.yml across public repos turns up only built-in dangerous-changes-style usage — none invoking a user-defined .js rule). That means upstream tests don’t exercise this surface, but it’s the only way to teach the action about repo-specific change criteria (e.g. our Deprecated since XX.YY.Z version notation, see our gql-inspector-checker.js).

Workaround we’re shipping

Until this is fixed, we’re pinning to:

env:
  ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: "true"
steps:
  - uses: actions/checkout@v6
  - uses: graphql-hive/graphql-inspector@release-1717403590269
    with:
      schema: '${{ github.base_ref }}:docs/manager/graphql-reference/schema.graphql'
      rules: |
        gql-inspector-checker.js

This keeps working today but will break once GitHub retires ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION.

Ask

  • Is rules: with a user-defined .js rule still a supported entry point in 5.x?
  • If yes, could you confirm the expected resolution rule (relative to repo root / workspace? ${{ github.workspace }} should work?), and what 5.0.12+ changed in the resolver?
  • If no longer supported, what is the recommended replacement for repo-specific rules?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions