Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter in the Octokit initialization to support GHES #194

Closed
Sorana-Maria opened this issue Nov 17, 2023 · 3 comments
Closed

Add parameter in the Octokit initialization to support GHES #194

Sorana-Maria opened this issue Nov 17, 2023 · 3 comments
Assignees

Comments

@Sorana-Maria
Copy link

Hi! We would like to make use of this action, but it won't work with the GitHub enterprise server version:
This initiates an octokit client with the given token. refer here
Octokit is from the @octokit/core and it needs an additional parameter [options.baseUrl] in the Octokit initialization to support the GHES.
Could it be added? Thank you!

@Balvajs
Copy link
Owner

Balvajs commented Nov 20, 2023

Yes, sure, that makes total sense.
I don't have experience with GHES, and I wonder if I can get that URL from the GHA context github.server_url, or if it has to be action input. @Sorana-Maria is it possible to get the GHES URL from github.server_url in your use case? If yes, I could do that internally without adding another user input.

image

@Balvajs Balvajs self-assigned this Nov 20, 2023
@Balvajs
Copy link
Owner

Balvajs commented Nov 20, 2023

Or maybe it's solved by @octokit/action out of the box, isn't it? I don't know why I am not using that lib instead 😅

Balvajs added a commit that referenced this issue Nov 20, 2023
As mentioned in #194, the current code doesn't support GitHub Enterprise
Server.
This PR fixes that by switching from `@octokit/core` to
`@octokit/action` which uses `baseUrl` from GitHub Action context and
therefore supports GHES out of the box.
@Balvajs
Copy link
Owner

Balvajs commented Nov 20, 2023

There is a new release now https://github.com/Balvajs/delete-stale-branches/releases/tag/v2.1.0, check it out, it should make this work for you 🚀

@Balvajs Balvajs closed this as completed Nov 20, 2023
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

No branches or pull requests

2 participants