Add optional base_url input to support GitHub Enterprise Octokit endpoints#176
Open
Add optional base_url input to support GitHub Enterprise Octokit endpoints#176
base_url input to support GitHub Enterprise Octokit endpoints#176Conversation
Agent-Logs-Url: https://github.com/github/accessibility-scanner/sessions/b5a52a27-e1a7-42dd-a5a7-07aff0f4fc7c Co-authored-by: JoyceZhu <6251669+JoyceZhu@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add configuration option for Octokit baseUrl in action.yml
Add optional Mar 25, 2026
base_url input to support GitHub Enterprise Octokit endpoints
JoyceZhu
reviewed
Mar 25, 2026
JoyceZhu
reviewed
Mar 25, 2026
JoyceZhu
reviewed
Mar 25, 2026
| description: "Personal access token (PAT) with fine-grained permissions 'contents: write', 'issues: write', and 'pull_requests: write'" | ||
| required: true | ||
| base_url: | ||
| description: "Optional base URL for the GitHub API (for example, 'https://HOSTNAME/api/v3' for GitHub Enterprise Server)" |
Contributor
There was a problem hiding this comment.
Suggested change
| description: "Optional base URL for the GitHub API (for example, 'https://HOSTNAME/api/v3' for GitHub Enterprise Server)" | |
| description: "Optional base URL to pass into Octokit for the GitHub API (for example, `https://YOUR_HOSTNAME/api/v3` for GitHub Enterprise Server)" |
JoyceZhu
reviewed
Mar 25, 2026
JoyceZhu
reviewed
Mar 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new optional base_url input to the top-level composite action and wires it through to the file and fix sub-actions so Octokit can target GitHub Enterprise Server (or other non-default GitHub API endpoints).
Changes:
- Added optional
base_urlinput to the rootaction.ymland forwarded it into thefileandfixsteps. - Added
base_urlinputs to.github/actions/fileand.github/actions/fixaction metadata and passed the value into Octokit construction in both entrypoints. - Documented the new input in the root README.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| action.yml | Defines base_url input and forwards it to file/fix sub-actions in the composite workflow. |
| README.md | Documents base_url in the usage example and inputs table. |
| .github/actions/file/action.yml | Declares base_url as an optional input for the file action. |
| .github/actions/file/src/index.ts | Reads base_url and passes it as Octokit baseUrl. |
| .github/actions/fix/action.yml | Declares base_url as an optional input for the fix action. |
| .github/actions/fix/src/index.ts | Reads base_url and passes it as Octokit baseUrl. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
helen
reviewed
Mar 26, 2026
|
|
||
| const octokit = new OctokitWithThrottling({ | ||
| auth: token, | ||
| baseUrl, |
Member
There was a problem hiding this comment.
Do we need the key here, even just to be consistent? (I am also overthinking the quotes oops)
Suggested change
| baseUrl, | |
| "baseUrl": baseUrl, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Octokit currently defaults to
https://api.github.com, which breaks API calls against GitHub Enterprise Server unlessbaseUrlis set explicitly.This PR introduces an action-level configuration for API base URL and threads it through the sub-actions that instantiate Octokit.
New action input
base_urlto rootaction.yml.https://HOSTNAME/api/v3.Input propagation through composite action
inputs.base_urlfrom the root action into:.github/actions/file.github/actions/fixOctokit configuration updates
file/src/index.tsandfix/src/index.ts, readbase_urlviacore.getInput('base_url', {required: false}).baseUrlintonew OctokitWithThrottling({...}).base_urlis omitted.Docs update
base_urlto README action input table and workflow example.Focused coverage
fileandfixaction entrypoints to assert:base_urlis passed as OctokitbaseUrlbase_urlleaves Octokit on default API base URL behavior💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.