Skip to content

chore: [] add copilot setup (NPM) - #2378

Closed
Steffen Neubauer (stefreak) wants to merge 1 commit into
mainfrom
copilot-setup
Closed

Steffen Neubauer (stefreak) wants to merge 1 commit into
mainfrom
copilot-setup

Conversation

@stefreak

@stefreak Steffen Neubauer (stefreak) commented Nov 28, 2025 •

Copy link
Copy Markdown

Summary by CodeRabbit

  • Chores
    • Updated project setup and build infrastructure configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Nov 28, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

A new GitHub Actions workflow is added that automates Node.js setup and dependency installation. The workflow triggers on manual dispatch, push, and pull request events. It configures npm to use GitHub Packages with a read-only token and runs npm ci for reproducible installations.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow Configuration
\.github/workflows/copilot-setup-steps.yml
New workflow file for setting up Node.js environment and dependencies with GitHub Packages integration. Includes checkout, Node.js v4 setup using .nvmrc, npm configuration with read-only token, and npm ci installation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the workflow trigger conditions are appropriate
  • Confirm the npm configuration and read-only token setup follows security best practices
  • Check that Node.js version resolution from .nvmrc is correct
  • Ensure GITHUB_TOKEN_PACKAGES_READONLY environment variable is properly exposed and scoped

Poem

A workflow springs to life so bright, 🐰
With Node and npm, all just right,
The Copilot takes its first setup stride,
Installing packages far and wide,
Automation hops with pure delight! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a GitHub Actions workflow for Copilot setup with NPM configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot-setup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 51da1d7 and 9f9e9da.

📒 Files selected for processing (1)
  • .github/workflows/copilot-setup-steps.yml (1 hunks)

Comment on lines +37 to +45
- name: set up global .npmrc
run: |
echo '//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN_PACKAGES_READONLY}' >> $HOME/.npmrc
echo 'ignore-scripts=true' >> $HOME/.npmrc

- name: Install JavaScript dependencies
run: npm ci
env:
GITHUB_TOKEN_PACKAGES_READONLY: ${{ github.token }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Environment variable not available when .npmrc is configured; token won't be authenticated.

The GITHUB_TOKEN_PACKAGES_READONLY environment variable is defined in the env: block of the "Install JavaScript dependencies" step (lines 44-45), but it's needed in the "set up global .npmrc" step (lines 37-40) where it's referenced. When the echo command runs on line 39, the variable doesn't exist in the environment, so npm will write the literal string ${GITHUB_TOKEN_PACKAGES_READONLY} to .npmrc instead of the actual token value. This will cause authentication failures for GitHub Packages.

Additionally, line 37 has a capitalization inconsistency: "set up" should be "Set up" to match other step names.

Apply this diff to fix the scoping issue and capitalization:

-      - name: set up global .npmrc
+      - name: Set up global .npmrc
         run: |
           echo '//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN_PACKAGES_READONLY}' >> $HOME/.npmrc
           echo 'ignore-scripts=true' >> $HOME/.npmrc
+        env:
+          GITHUB_TOKEN_PACKAGES_READONLY: ${{ github.token }}
 
       - name: Install JavaScript dependencies
         run: npm ci
-        env:
-          GITHUB_TOKEN_PACKAGES_READONLY: ${{ github.token }}
🤖 Prompt for AI Agents
.github/workflows/copilot-setup-steps.yml around lines 37 to 45: the step that
writes the global .npmrc references GITHUB_TOKEN_PACKAGES_READONLY but that env
is only set on the later "Install JavaScript dependencies" step, so the token
isn't available when echo runs; change the step name capitalization to "Set up
global .npmrc" and move or add the GITHUB_TOKEN_PACKAGES_READONLY environment
variable to the .npmrc step (or define it at the job level) so the token expands
during the echo command, ensuring the credential is written correctly.

@stefreak

Copy link
Copy Markdown
Author

Copilot setup only necessary for private repositories

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.

1 participant