Fix annotations for pull requests#50
Conversation
Finalize PR
|
@aswamy Do you have any update on this? We really want to integrate this tool in our CI |
aswamy
left a comment
There was a problem hiding this comment.
Hey @andershagbard, i was just trying to run this on a repo and had a question
| .flatMap((report) => | ||
| report.offenses.map((offense) => ({ | ||
| path: path.relative(root, path.resolve(report.path)), | ||
| path: path.relative(cwd, path.resolve(report.path)), |
There was a problem hiding this comment.
Why is this not from the root anymore?
There was a problem hiding this comment.
I think it was because the Shopify files are not necessarily in the root of the repo
There was a problem hiding this comment.
Right. might have diff root, so src/snippets/foo.liquid instead of snippets/foo.liquid? Could be useful for multi-root setups, 👍
|
Updated this PR. Threw out all non related to making the annotations work. Will put the other stuff into different PRs |
|
Tested out the latest change and looks like the action works as expected:
|
|
@charlespwd Did the dist build correctly? I am getting these this error now: |
|
@charlespwd getting an error alike @andershagbard npm error Cannot read properties of null (reading 'matches')
npm error A complete log of this run can be found in: /root/.npm/_logs/2025-06-24T08_56_45_265Z-debug-0.log
Error: The process '/root/actions-runner/_work/_tool/node/22.15.1/x64/bin/npm' failed with exit code 1
at ExecState._setResult (/root/actions-runner/_work/_actions/shopify/theme-check-action/v2/dist/index.js:1:24684)
at ExecState.CheckComplete (/root/actions-runner/_work/_actions/shopify/theme-check-action/v2/dist/index.js:1:24244)
at ChildProcess.<anonymous> (/root/actions-runner/_work/_actions/shopify/theme-check-action/v2/dist/index.js:1:23085)
at ChildProcess.emit (node:events:524:28)
at maybeClose (node:internal/child_process:1[104](https://github.com/cybersikker/shopify/actions/runs/15845939450/job/44668025814#step:6:105):16)
at ChildProcess._handle.onexit (node:internal/child_process:304:5)
Error: The process '/root/actions-runner/_work/_tool/node/22.15.1/x64/bin/npm' failed with exit code 1 |
|
Yeah please. |
|
Seems to be from a dependency? What the hell? I transpiled without minifying and even then I couldn't find where we'd be doing |
|
@charlespwd I think I've had this issue before. I had to use my worker (Linux) to run Example from my repo: - name: Compile assets
run: pnpm build # Running the ncc command
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions |
Full workflow error Run shopify/theme-check-action@v2
with:
theme_root: ./src
flags: --fail-level warning
token: ***
base: main
env:
PNPM_HOME: /root/setup-pnpm/node_modules/.bin
/root/actions-runner/_work/_tool/node/22.15.1/x64/bin/npm install --no-package-lock --no-save @shopify/cli
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: @jridgewell/trace-mapping@0.3.25
npm warn Found: peer typescript@">=3.7.0" from @rollup/plugin-typescript@11.1.6
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/node_modules/@rollup/plugin-typescript
npm warn dev @rollup/plugin-typescript@"11.1.6" from @jridgewell/trace-mapping@0.3.25
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping
npm warn
npm warn Could not resolve dependency:
npm warn peer typescript@">=3.7.0" from @rollup/plugin-typescript@11.1.6
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/node_modules/@rollup/plugin-typescript
npm warn dev @rollup/plugin-typescript@"11.1.6" from @jridgewell/trace-mapping@0.3.25
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: @jridgewell/trace-mapping@0.3.25
npm warn Found: peer eslint@"^7.0.0 || ^8.0.0" from @typescript-eslint/eslint-plugin@6.18.1
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/node_modules/@typescript-eslint/eslint-plugin
npm warn dev @typescript-eslint/eslint-plugin@"6.18.1" from @jridgewell/trace-mapping@0.3.25
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping
npm warn
npm warn Could not resolve dependency:
npm warn peer eslint@"^7.0.0 || ^8.0.0" from @typescript-eslint/eslint-plugin@6.18.1
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/node_modules/@typescript-eslint/eslint-plugin
npm warn dev @typescript-eslint/eslint-plugin@"6.18.1" from @jridgewell/trace-mapping@0.3.25
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: @jridgewell/trace-mapping@0.3.25
npm warn Found: peer @typescript-eslint/parser@"^6.0.0 || ^6.0.0-alpha" from @typescript-eslint/eslint-plugin@6.18.1
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/node_modules/@typescript-eslint/eslint-plugin
npm warn dev @typescript-eslint/eslint-plugin@"6.18.1" from @jridgewell/trace-mapping@0.3.25
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping
npm warn
npm warn Could not resolve dependency:
npm warn peer @typescript-eslint/parser@"^6.0.0 || ^6.0.0-alpha" from @typescript-eslint/eslint-plugin@6.18.1
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/node_modules/@typescript-eslint/eslint-plugin
npm warn dev @typescript-eslint/eslint-plugin@"6.18.1" from @jridgewell/trace-mapping@0.3.25
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: @jridgewell/trace-mapping@0.3.25
npm warn Found: peer eslint@"^7.0.0 || ^8.0.0" from @typescript-eslint/parser@6.18.1
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/node_modules/@typescript-eslint/parser
npm warn dev @typescript-eslint/parser@"6.18.1" from @jridgewell/trace-mapping@0.3.25
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping
npm warn 1 more (@typescript-eslint/eslint-plugin)
npm warn
npm warn Could not resolve dependency:
npm warn peer eslint@"^7.0.0 || ^8.0.0" from @typescript-eslint/parser@6.18.1
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/node_modules/@typescript-eslint/parser
npm warn dev @typescript-eslint/parser@"6.18.1" from @jridgewell/trace-mapping@0.3.25
npm warn node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping
npm warn 1 more (@typescript-eslint/eslint-plugin)
npm warn ERESOLVE overriding peer dependency
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: @ampproject/remapping@2.3.0
npm warn Found: peer @typescript-eslint/parser@"^5.0.0" from @typescript-eslint/eslint-plugin@5.20.0
npm warn node_modules/.pnpm/@ampproject+remapping@2.3.0/node_modules/@ampproject/remapping/node_modules/@typescript-eslint/eslint-plugin
npm warn dev @typescript-eslint/eslint-plugin@"5.20.0" from @ampproject/remapping@2.3.0
npm warn node_modules/.pnpm/@ampproject+remapping@2.3.0/node_modules/@ampproject/remapping
npm warn
npm warn Could not resolve dependency:
npm warn peer @typescript-eslint/parser@"^5.0.0" from @typescript-eslint/eslint-plugin@5.20.0
npm warn node_modules/.pnpm/@ampproject+remapping@2.3.0/node_modules/@ampproject/remapping/node_modules/@typescript-eslint/eslint-plugin
npm warn dev @typescript-eslint/eslint-plugin@"5.20.0" from @ampproject/remapping@2.3.0
npm warn node_modules/.pnpm/@ampproject+remapping@2.3.0/node_modules/@ampproject/remapping
npm warn ERESOLVE overriding peer dependency
npm warn ERESOLVE overriding peer dependency
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: @jridgewell/gen-mapping@0.3.8
npm warn Found: peer @typescript-eslint/parser@"^5.0.0" from @typescript-eslint/eslint-plugin@5.21.0
npm warn node_modules/.pnpm/@jridgewell+gen-mapping@0.3.8/node_modules/@jridgewell/gen-mapping/node_modules/@typescript-eslint/eslint-plugin
npm warn dev @typescript-eslint/eslint-plugin@"5.21.0" from @jridgewell/gen-mapping@0.3.8
npm warn node_modules/.pnpm/@jridgewell+gen-mapping@0.3.8/node_modules/@jridgewell/gen-mapping
npm warn
npm warn Could not resolve dependency:
npm warn peer @typescript-eslint/parser@"^5.0.0" from @typescript-eslint/eslint-plugin@5.21.0
npm warn node_modules/.pnpm/@jridgewell+gen-mapping@0.3.8/node_modules/@jridgewell/gen-mapping/node_modules/@typescript-eslint/eslint-plugin
npm warn dev @typescript-eslint/eslint-plugin@"5.21.0" from @jridgewell/gen-mapping@0.3.8
npm warn node_modules/.pnpm/@jridgewell+gen-mapping@0.3.8/node_modules/@jridgewell/gen-mapping
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: prettier-plugin-tailwindcss@0.6.13
npm warn Found: peer svelte@"^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0" from prettier-plugin-svelte@3.4.0
npm warn node_modules/.pnpm/prettier-plugin-tailwindcss@0.6.13_@shopify+prettier-plugin-liquid@1.9.3_prettier@3.6.0__prettier@3.6.0/node_modules/prettier-plugin-tailwindcss/node_modules/prettier-plugin-svelte
npm warn dev prettier-plugin-svelte@"^3.1.2" from prettier-plugin-tailwindcss@0.6.13
npm warn node_modules/.pnpm/prettier-plugin-tailwindcss@0.6.13_@shopify+prettier-plugin-liquid@1.9.3_prettier@3.6.0__prettier@3.6.0/node_modules/prettier-plugin-tailwindcss
npm warn
npm warn Could not resolve dependency:
npm warn peer svelte@"^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0" from prettier-plugin-svelte@3.4.0
npm warn node_modules/.pnpm/prettier-plugin-tailwindcss@0.6.13_@shopify+prettier-plugin-liquid@1.9.3_prettier@3.6.0__prettier@3.6.0/node_modules/prettier-plugin-tailwindcss/node_modules/prettier-plugin-svelte
npm warn dev prettier-plugin-svelte@"^3.1.2" from prettier-plugin-tailwindcss@0.6.13
npm warn node_modules/.pnpm/prettier-plugin-tailwindcss@0.6.13_@shopify+prettier-plugin-liquid@1.9.3_prettier@3.6.0__prettier@3.6.0/node_modules/prettier-plugin-tailwindcss
npm error Cannot read properties of null (reading 'matches')
npm error A complete log of this run can be found in: /root/.npm/_logs/2025-06-24T11_13_38_759Z-debug-0.log
Error: The process '/root/actions-runner/_work/_tool/node/22.15.1/x64/bin/npm' failed with exit code 1
at ExecState._setResult (/root/actions-runner/_work/_actions/shopify/theme-check-action/v2/dist/index.js:1:24684)
at ExecState.CheckComplete (/root/actions-runner/_work/_actions/shopify/theme-check-action/v2/dist/index.js:1:24244)
at ChildProcess.<anonymous> (/root/actions-runner/_work/_actions/shopify/theme-check-action/v2/dist/index.js:1:23085)
at ChildProcess.emit (node:events:524:28)
at maybeClose (node:internal/child_process:1104:16)
at ChildProcess._handle.onexit (node:internal/child_process:304:5)
Error: The process '/root/actions-runner/_work/_tool/node/22.15.1/x64/bin/npm' failed with exit code 1 |
|
What the hell so it's the npm install that is causing issue? This is weird because we're running this in both Horizon and Dawn and the CI is green... Wondering if it has to do with some kind of conflict with a package.json that y'all have? Maybe I need more flags? Something like don't install dev deps of CLI or somethign? Probably why it complains about svelte peer dependencies? Hard to fix this if I can't reproduce. Can you try adding a step in your CI jobs that remove the package.json before running this command? |
It works as expected when removing the |
|
I think this is related to If I just install Should we give #42 a go again? |

annotation.pathis relative to GitHub, and not the--pathvalue...ctx.repo