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

Inject GitHub host to be able to clone from another GitHub instance #922

Merged
merged 3 commits into from Sep 26, 2022

Conversation

peter-murray
Copy link
Contributor

These changes allow for the base URL of another GitHub instance to be provided to the action so that a workflow running on a GHES server can clone a repository from another GHES server or github.com.

These changes maintain the existing default behaviour whilst allowing for a user to inject a URL to alternate GitHub instance and have been validated using an actions runner with and without a git command line client (i.e. git command line clone and HTTP cloning) have been tested.

@@ -778,7 +778,8 @@ async function setup(testName: string): Promise<void> {
sshKnownHosts: '',
sshStrict: true,
workflowOrganizationId: 123456,
setSafeDirectory: true
setSafeDirectory: true,
githubServerUrl: undefined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have a test with githubServerUrl set to some URL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added tests to the branch and refactored the one that was there to use common code for that test


export type OctokitOptions = {
baseUrl?: string
userAgent?: string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anything set this userAgent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Link- Link- self-requested a review September 15, 2022 13:53
@Link- Link- self-assigned this Sep 15, 2022
@Link- Link- added the enhancement New feature or request label Sep 15, 2022
@peter-murray peter-murray requested a review from a team as a code owner September 15, 2022 14:17
src/octokit-helper.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@Link- Link- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peter-murray can you please run npm run format and push the changes?

Otherwise, I don't see any glaring issues with this change.

Copy link
Contributor

@Link- Link- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor feedback, otherwise LGTM

src/octokit-helper.ts Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
peter-murray added a commit to peter-murray/checkout that referenced this pull request Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants