Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 16, 2025

The hourly-ci-cleaner workflow was missing Node.js setup between the conditional CI status check and the npm ci step, causing dependency installation to fail when the workflow continued past the check.

Changes

  • Added setup-node@v6 step between "Setup Go" and "Install npm dependencies" in hourly-ci-cleaner.md
  • Configured Node 24 with npm caching for pkg/workflow/js/package-lock.json
  • Regenerated hourly-ci-cleaner.lock.yml via make recompile

The compiler merged this configuration with the existing auto-generated Node.js setup, adding npm caching support to improve performance.

Workflow sequence

steps:
  - name: Check CI status    # exits if passing, continues if failing
  - name: Install Make
  - name: Setup Go
  - name: Set up Node.js     # ← added
    uses: actions/setup-node@v6
    with:
      node-version: "24"
      cache: npm
      cache-dependency-path: pkg/workflow/js/package-lock.json
  - name: Install npm dependencies
Original prompt

This section details on the original issue you should resolve

<issue_title>[ca] Add Node.js setup step before npm install in hourly-ci-cleaner</issue_title>
<issue_description>## Problem

The hourly-ci-cleaner workflow was failing because it tries to run npm ci without having Node.js set up first. While Node.js is set up at the beginning of the job (line 42), it's needed again after the CI status check step runs.

Root Cause

The workflow has this sequence:

  1. Setup Node.js (early in job)
  2. Check CI status - exits with code 1 if CI is passing
  3. Install Make
  4. Setup Go
  5. Install npm dependencies ← FAILS because Node.js setup is before the conditional exit

When CI is failing, step #2 continues, but there's no Node.js setup between the conditional check and the npm install.

Fix

Added the setup-node action before the "Install npm dependencies" step to ensure Node.js is available when needed. This matches the pattern used in other workflows like ci-coach.md.

Changes

  • Added setup-node@v6 action with Node 24 and npm caching
  • Positioned it between "Setup Go" and "Install npm dependencies" steps
  • Uses the same configuration as the main CI workflow

Testing

The workflow should now be able to:

  1. Check CI status
  2. If failing, set up build tools (Make, Go, Node.js)
  3. Install dependencies successfully
  4. Run the CI cleaner agent

Note

This commit only updates the .md file. The .lock.yml file needs to be regenerated by running make recompile, which requires a working build environment.

AI generated by Hourly CI Cleaner


[!NOTE]
This was originally intended as a pull request, but the git push operation failed.

Workflow Run: View run details and download patch artifact

The patch file is available as an artifact (aw.patch) in the workflow run linked above.
To apply the patch locally:

# Download the artifact from the workflow run https://github.com/githubnext/gh-aw/actions/runs/20279579492
# (Use GitHub MCP tools if gh CLI is not available)
gh run download 20279579492 -n aw.patch
# Apply the patch
git am aw.patch
Show patch (34 lines)
From e7260d820f78f4474367bc9f8cd15cbbdb5dd323 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Tue, 16 Dec 2025 19:11:43 +0000
Subject: [PATCH] fix: Add Node.js setup step to hourly-ci-cleaner workflow

The hourly-ci-cleaner workflow was missing the setup-node action,
which caused npm ci to fail since Node.js was not available. This
adds the setup-node action with Node 24 and npm caching, matching
the configuration used in the main CI workflow.
---
 .github/workflows/hourly-ci-cleaner.md | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/.github/workflows/hourly-ci-cleaner.md b/.github/workflows/hourly-ci-cleaner.md
index 474100b..6b7b26e 100644
--- a/.github/workflows/hourly-ci-cleaner.md
+++ b/.github/workflows/hourly-ci-cleaner.md
@@ -52,6 +52,12 @@ steps:
     with:
       go-version-file: go.mod
       cache: true
+  - name: Setup Node.js
+    uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
+    with:
+      node-version: "24"
+      cache: npm
+      cache-dependency-path: pkg/workflow/js/package-lock.json
   - name: Install npm dependencies
     run: npm ci
     working-directory: ./pkg/workflow/js
-- 
2.34.1

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Node.js setup step before npm install in hourly-ci-cleaner Add Node.js setup with npm caching to hourly-ci-cleaner workflow Dec 16, 2025
Copilot AI requested a review from mnkiefer December 16, 2025 20:28
@pelikhan pelikhan marked this pull request as ready for review December 16, 2025 21:29
@pelikhan pelikhan merged commit 0145e2c into main Dec 16, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/add-nodejs-setup-step branch December 16, 2025 21:29
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.

[ca] Add Node.js setup step before npm install in hourly-ci-cleaner

3 participants