Skip to content

Commit

Permalink
chore(release): remaining items
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry committed Sep 9, 2024
1 parent 91d4fa3 commit 60b4f00
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/nx/release/changelog-renderer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export type ChangelogRenderer = (config: {
entryWhenNoChanges: string | false;
changelogRenderOptions: DefaultChangelogRenderOptions;
dependencyBumps?: DependencyBump[];
// TODO(v20): remove repoSlug in favour of repoData
repoSlug?: RepoSlug;
repoData?: GithubRepoData;
// TODO(v20): Evaluate if there is a cleaner way to configure this when breaking changes are allowed
Expand Down
21 changes: 21 additions & 0 deletions packages/nx/schemas/nx-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,9 @@
{
"type": "boolean",
"enum": [false]
},
{
"ref": "#/definitions/CreateReleaseProviderConfiguration"
}
]
},
Expand Down Expand Up @@ -724,6 +727,24 @@
}
}
},
"CreateReleaseProviderConfiguration": {
"type": "object",
"properties": {
"provider": {
"type": "string",
"enum": ["github-enterprise-server"]
},
"hostname": {
"type": "string",
"description": "The hostname of the VCS provider instance, e.g. github.example.com"
},
"apiBaseUrl": {
"type": "string",
"description": "The base URL for the relevant VCS provider API. If not set, this will default to `https://${hostname}/api/v3`"
}
},
"required": ["provider", "hostname"]
},
"NxReleaseVersionPlansConfiguration": {
"type": "object",
"properties": {
Expand Down
5 changes: 4 additions & 1 deletion packages/nx/src/command-line/release/utils/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function getGitHubRepoData(

// Extract the 'user/repo' part from the URL
const escapedHostname = hostname.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
const regexString = `${escapedHostname}[/:]([\\w-]+/[\\w-]+)`;
const regexString = `${escapedHostname}[/:]([\\w.-]+/[\\w.-]+)(\\.git)?`;
const regex = new RegExp(regexString);
const match = remoteUrl.match(regex);

Expand Down Expand Up @@ -370,6 +370,9 @@ async function resolveGithubToken(hostname: string): Promise<string | null> {
}
}
}
console.log(
`Warning: It was not possible to automatically resolve a GitHub token from your environment for hostname ${hostname}. If you set the GITHUB_TOKEN or GH_TOKEN environment variable, that will be used for GitHub API requests.`
);
return null;
}

Expand Down

0 comments on commit 60b4f00

Please sign in to comment.