Fixes 329#332
Conversation
Signed-off-by: Joao Pereira <joaopapereira@gmail.com>
Signed-off-by: Joao Pereira <joaopapereira@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #329 (“Issues running in Enterprise GitHub”) by making the GitHub API base URL configurable (defaulting to https://api.github.com) so the action can fetch Carvel releases from GitHub.com even when running on GHES, while still allowing users to target a GHES API when hosting the repos there.
Changes:
- Add a new
endpointinput and use it as the OctokitbaseUrlwhen creating the GitHub client. - Upgrade
@actions/core/@actions/githubdependencies and adjust Jest configuration/mocks accordingly. - Update docs/examples (including bumping usage examples to
@v3).
Reviewed changes
Copilot reviewed 6 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/main.ts |
Reads endpoint input and passes it to Octokit baseUrl when a token is provided. |
action.yml |
Introduces the new endpoint input (default https://api.github.com). |
README.md |
Updates examples to @v3 and adds GHES/GitHub.com usage guidance. |
package.json / package-lock.json |
Bumps Actions toolkit dependencies and updates lockfile. |
jest.config.js + test/__mocks__/* |
Adds module mapping/mocks for updated Actions toolkit packages. |
tsconfig.json |
Adjusts include/exclude and enables allowJs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Joao Pereira <joaopapereira@gmail.com>
8ad1ea2 to
8727966
Compare
Signed-off-by: Joao Pereira <joaopapereira@gmail.com>
3f6406e to
239cbf4
Compare
|
@jbrunton We have an issue with github@6.0.1 that is +- a year old, but not sure if upgrading to the latest version of the library is going to impact any other code on the libraries that you built underneath, so I kept it around 6.* |
|
If I do not get any more feedback will merge it next monday |
|
Can't wait for this to land! |
fixes #329
The approach here is to force the URL used to always be api.github.com, allowing for the users to define a different one if they want to have the carvel repositories in their own instance.
The more important thing to have into account is that the github token used has to be valid in the github instance you are retrieving the releases of the carvel tools from.
Ex: In the following case the github token used HAS to be valid in github.com
Ex: In the following case the github token used HAS to be valid in acme.github.com