Conversation
| `git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, | ||
| this.settings.nestedSubmodules | ||
| ) | ||
| for (const insteadOfValue of this.insteadOfValues) { |
There was a problem hiding this comment.
this is for submodule config (recursive submodules)
| this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf` // "origin" is SCHEME://HOSTNAME[:PORT] | ||
| this.insteadOfValue = `git@${serverUrl.hostname}:` | ||
| this.insteadOfValues.push(`git@${serverUrl.hostname}:`) | ||
| if (this.settings.workflowOrganizationId) { |
There was a problem hiding this comment.
register extra prefix now
| if (!this.settings.sshKey) { | ||
| await this.git.config(this.insteadOfKey, this.insteadOfValue, true) | ||
| for (const insteadOfValue of this.insteadOfValues) { | ||
| await this.git.config(this.insteadOfKey, insteadOfValue, true, true) |
There was a problem hiding this comment.
when configuring auth, now we register multiple instead-of values
this translates submodule URLs like:
[email protected]:my-org/my-submodule.git -> https://github.com/my-org/my-submodule.git
[email protected]:my-org/my-submodule.git -> https://github.com/my-org/my-submodule.git
| ]) | ||
| const args: string[] = ['config', globalConfig ? '--global' : '--local'] | ||
| if (add) { | ||
| args.push('--add') |
There was a problem hiding this comment.
this is required in order to add two insteadOf URLs
There was a problem hiding this comment.
Try out running checkout on two separate occasions (i.e. the repo is not deleted in between runs).
| /** | ||
| * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH | ||
| */ | ||
| export async function getOrganizationId(): Promise<number | undefined> { |
There was a problem hiding this comment.
best effort, debug log if can't load
|
Changes LGTM 👍 . The only thing pending to test is that |
| /** | ||
| * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH | ||
| */ | ||
| export async function getOrganizationId(): Promise<number | undefined> { |
|
🧩 |
GitHub Enterprise Server can show a SSH URLs that includes organization ID, too: https://docs.github.com/en/[email protected]/organizations/managing-git-access-to-your-organizations-repositories/about-ssh-certificate-authorities#about-ssh-urls-with-ssh-certificates Follow-up: ec3a7ce (<actions#621>)
GitHub Enterprise Server can show a SSH URLs that includes organization ID, too: https://docs.github.com/en/[email protected]/organizations/managing-git-access-to-your-organizations-repositories/about-ssh-certificate-authorities#about-ssh-urls-with-ssh-certificates Follow-up: ec3a7ce 🔗 actions#621
fixes #570
When ssl certificate authentication is enabled, the clone UI suggested in the UI is like
org-<ORG_ID>@github.com:<ORG>/<REPO>.gitinstead of the normal format[email protected]:<ORG>/<REPO>.gitWe need to register a git config
insteadOfurl to handle the new format. Today users set the inputsubmodules: trueand the inputssh-keyis not provided, we register an insteadOf config so SSH URLs beginning with[email protected]:are converted to HTTPS. We need to do the same thing for the new format.