Skip to content

Fix workflow failures by adding Node.js setup for prettier pre-commit hook#3

Open
Copilot wants to merge 3 commits intomainfrom
copilot/debug-workflow-failures
Open

Fix workflow failures by adding Node.js setup for prettier pre-commit hook#3
Copilot wants to merge 3 commits intomainfrom
copilot/debug-workflow-failures

Conversation

Copy link
Contributor

Copilot AI commented Oct 15, 2025

Problem

The GitHub Actions workflows were consistently failing with the error:

[error] Cannot find package 'prettier-plugin-toml' imported from /home/runner/work/ml-template/ml-template/noop.js

The root cause was a mismatch between the pre-commit configuration and the CI environment setup. The .pre-commit-config.yaml included a prettier hook that requires Node.js and npm, but the workflow only installed Python and uv.

Solution

This PR fixes the workflow failures by ensuring all required dependencies are available in the CI environment:

Added Node.js setup to the workflow

Updated .github/workflows/python-package.yml to install Node.js 18 before running pre-commit hooks:

- name: Set up Node.js
  uses: actions/setup-node@v3
  with:
    node-version: '18'

This allows the custom will-rice/prettier-pre-commit hook (v1.0.7) to run successfully in the CI environment.

Testing

The changes have been tested locally and ensure that:

  • All pre-commit hooks can run successfully with the required dependencies
  • The prettier hook properly formats files without errors
  • The workflow can complete all Python version matrices (3.10, 3.11, 3.12)
Original prompt

can you figure out why the workflows keep failing. maybe npm is not installed?


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: will-rice <25072137+will-rice@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues causing workflow failures Fix workflow failures by adding Node.js setup for prettier pre-commit hook Oct 15, 2025
Copilot AI requested a review from will-rice October 15, 2025 13:10
@will-rice
Copy link
Owner

will-rice commented Oct 15, 2025

@copilot I want to use my prettier pre-commit since the official is archived

@will-rice will-rice marked this pull request as ready for review October 15, 2025 14:33
@will-rice
Copy link
Owner

@copilot I want to use my pre-commit

Co-authored-by: will-rice <25072137+will-rice@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 15, 2025

@copilot I want to use my prettier pre-commit since the official is archived

Reverted back to using your prettier pre-commit hook in commit 1d0da84. The Node.js setup remains in the workflow to ensure it works properly.

@copilot I want to use my pre-commit

Done - reverted to your pre-commit hook in commit 1d0da84.

Copy link
Owner

@will-rice will-rice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants