This repository was archived by the owner on Jul 7, 2025. It is now read-only.
Add github_url input defaulting to GITHUB_API_URL#43
Merged
tibdex merged 3 commits intotibdex:mainfrom Oct 16, 2022
cliffchapmanrbx:faeture/add-server-url-input
Merged
Add github_url input defaulting to GITHUB_API_URL#43tibdex merged 3 commits intotibdex:mainfrom cliffchapmanrbx:faeture/add-server-url-input
tibdex merged 3 commits intotibdex:mainfrom
cliffchapmanrbx:faeture/add-server-url-input
Conversation
retiman
suggested changes
Aug 15, 2022
| permissions: | ||
| description: The JSON-stringified permissions granted to the token (defaults to all the GitHub app permissions, see https://docs.github.com/en/rest/apps/apps#create-an-installation-access-token-for-an-app). | ||
| github_url: | ||
| description: The API URL of the GitHub server, such as https://api.github.com. Defaults to the environment variable GITHUB_API_URL, see https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables. |
Contributor
There was a problem hiding this comment.
Consider adding default: ${{ github.api_url }}.
Contributor
Author
There was a problem hiding this comment.
The other inputs aren't written that way so I was sticking with the same pattern. I'm open to using this if the repo maintainer would prefer it.
src/index.ts
Outdated
| const githubUrlInput = getInput("github_url"); | ||
| const baseUrl = githubUrlInput | ||
| ? new URL(githubUrlInput) | ||
| : new URL(env.GITHUB_API_URL); |
Contributor
There was a problem hiding this comment.
I believe this is unnecessary if you have a default set to ${{ github.api_url }}.
Contributor
Author
There was a problem hiding this comment.
Same deal, mostly duplicating the existing pattern in the code instead of introducing a new one. I'm also open to changing it around if the maintainer would prefer.
Owner
|
Thanks 👍 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Resolves #42
This adds a
github_urlparameter to the inputs so the baseUrl parameter for Octokit can be overridden. Currently it defaults to the GitHub Actions-supplied environment variable that contains the API URL for the local GitHub server. This env var cannot be overridden through any other means because it's managed by GitHub Actions.The input defaults to the same env var, so existing users are unaffected and this should not require a major version bump.
I added the round-trip through the URL class to get some minimal URL validation for free. I'm negotiable on whether this is considered valuable or it would be better to just treat it as a raw string instead, up to you.