Skip to content

fix: [BUG][github-action] GitHub Enterprise | Incorrect bot comment url (#2052)#132

Open
nikhil-mittal-165 wants to merge 2 commits into
mainfrom
fix/issue-2052-ghes-server-url
Open

fix: [BUG][github-action] GitHub Enterprise | Incorrect bot comment url (#2052)#132
nikhil-mittal-165 wants to merge 2 commits into
mainfrom
fix/issue-2052-ghes-server-url

Conversation

@nikhil-mittal-165

Copy link
Copy Markdown
Contributor

Summary

Fixes forcedotcom/code-analyzer#2052

Root Cause

In src/dependencies.ts lines 131-133, the createActionSummaryLink method hardcodes 'https://github.com/' as the URL prefix when constructing the job summary link for the PR review comment. On GitHub Enterprise Server instances, the server URL is different (e.g. https://github.securian.com). The @actions/github package already provides github.context.serverUrl which reads from the GITHUB_SERVER_URL environment variable (set by GitHub Actions runtime to the correct server URL), but the code doesn't use it. The fix is to replace the hardcoded 'https://github.com' with github.context.serverUrl in both URL template literals.

Fix

Replaced hardcoded https://github.com with github.context.serverUrl in createActionSummaryLink to support GitHub Enterprise Server instances

Testing

  • ✅ Unit tests added/updated
  • ✅ All tests passing
  • ✅ Lint checks passing

Functional Testing Evidence

Tested on Dreamhouse project:

  • Test 1: GitHub Action integration with fix/issue-2052-ghes-server-url branch - PASS; Workflow executed successfully (https://github.com/nikhil-mittal-165/apex-test/actions/runs/28152934495); Build completed with success conclusion; Code-Analyzer action ran and scanned apex-test repo (36 violations found - 12 High, 1 Moderate, 23 Low)
  • Test 2: Source code fix verification - PASS; src/dependencies.ts lines 132 and 134 use serverUrl variable instead of hardcoded https://github.com/
  • Test 3: Compiled distribution verification - PASS; Built dist/index.js contains correct serverUrl usage in URL template literals

Overall Status: PASS ✅

@git2gus

git2gus Bot commented Jun 25, 2026

Copy link
Copy Markdown

Git2Gus App is installed but the .git2gus/config.json doesn't have right values. You should add the required configuration.

@nikhil-mittal-165 nikhil-mittal-165 marked this pull request as ready for review June 25, 2026 07:06

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Salesforce Code Analyzer found 13 violations, including 3 in files changed by this pull request. See job summary page.

@nikhil-mittal-165 nikhil-mittal-165 force-pushed the fix/issue-2052-ghes-server-url branch from 6d8d2c6 to 56bae6f Compare June 25, 2026 07:14

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Salesforce Code Analyzer found 13 violations, including 3 in files changed by this pull request. See job summary page.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Salesforce Code Analyzer found 13 violations, including 3 in files changed by this pull request. See job summary page.

@aruntyagiTutu aruntyagiTutu 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.

PR Review Complete - APPROVED

Excellent bug fix for GitHub Enterprise Server compatibility!

Compliance Summary:

  • Clear root cause analysis and fix
  • Proper use of github.context.serverUrl API
  • dist/index.js updated correctly (required for GitHub Actions)
  • Excellent test coverage (2 new GHES test cases added)
  • Clean commit messages referencing issue #2052
  • Functional testing evidence provided

Technical Review:

  • Replaces hardcoded https://github.com with serverUrl in both URL templates
  • Tests cover both matching job (with #summary-X anchor) and no-match scenarios
  • Fix is minimal and focused - exactly what is needed
  • No performance concerns (simple string interpolation)

Minor Note:

  • package-lock.json shows node engine change to >=24.0.0 - verify this is intentional and aligned with team node version policy

This follows all GitHub Action specific guidelines from the review standards. Ready to merge!

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.

[BUG][github-action] GitHub Enterprise | Incorrect bot comment url

2 participants