fix: [BUG][github-action] GitHub Enterprise | Incorrect bot comment url (#2052)#132
fix: [BUG][github-action] GitHub Enterprise | Incorrect bot comment url (#2052)#132nikhil-mittal-165 wants to merge 2 commits into
Conversation
|
Git2Gus App is installed but the |
There was a problem hiding this comment.
6d8d2c6 to
56bae6f
Compare
There was a problem hiding this comment.
There was a problem hiding this comment.
aruntyagiTutu
left a comment
There was a problem hiding this comment.
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!
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
Functional Testing Evidence
Tested on Dreamhouse project:
Overall Status: PASS ✅