mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-25 08:48:08 +02:00
fix(release): point repository URLs at renamed GitHub repo (#250)
* fix(release): point repository URLs at renamed GitHub repo The GitHub repo was renamed from Kaelio/ktx to Kaelio/ktx-ai-data-agents-context. semantic-release reads repositoryUrl from package.json's repository field and the @semantic-release/github plugin failed verifyConditions with EMISMATCHGITHUBURL because it no longer matched the live clone URL. Update every Kaelio/ktx reference to the renamed repo: package metadata (root + CLI repository/bugs/homepage), the codecov upload slugs and star-history slug in CI, the issue-template and security-advisory links, the release runbook, and all docs/install commands. * fix(release): derive semantic-release repositoryUrl from the CI repo @semantic-release/github exact-matches repositoryUrl against the live GitHub clone_url (no redirect following), so any repo rename re-breaks the release when repositoryUrl is the static package.json value. Derive repositoryUrl from the runner's GITHUB_REPOSITORY/GITHUB_SERVER_URL so it always tracks the current repo name. A future rename (including back to Kaelio/ktx) now resolves with no code change. Outside CI the option is omitted, so semantic-release falls back to package.json as documented. The package.json repository field stays ktx-ai-data-agents-context as npm-display metadata, decoupled from the release-time match.
This commit is contained in:
parent
9133d243e8
commit
41f52797de
17 changed files with 94 additions and 33 deletions
|
|
@ -104,6 +104,22 @@ function releaseTag(kind, env = process.env) {
|
|||
return `branch-${branchPrereleaseId(branchName)}`;
|
||||
}
|
||||
|
||||
function repositoryUrl(env = process.env) {
|
||||
// @semantic-release/github compares this URL's owner/repo against the live
|
||||
// GitHub clone_url with an exact match (no redirect following), so a repo
|
||||
// rename breaks the release unless repositoryUrl tracks the *current* name.
|
||||
// In CI, derive it from the runner's repository so renames never re-break the
|
||||
// release. Outside CI, return undefined so semantic-release falls back to the
|
||||
// package.json `repository` field (its documented default).
|
||||
const repository = env.GITHUB_REPOSITORY;
|
||||
if (!repository) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const server = env.GITHUB_SERVER_URL || 'https://github.com';
|
||||
return `${server}/${repository}.git`;
|
||||
}
|
||||
|
||||
function releaseBranches(env = process.env) {
|
||||
const kind = releaseKind(env);
|
||||
|
||||
|
|
@ -127,10 +143,12 @@ function releaseBranches(env = process.env) {
|
|||
function createReleaseConfig(env = process.env) {
|
||||
const kind = releaseKind(env);
|
||||
const tag = releaseTag(kind, env);
|
||||
const url = repositoryUrl(env);
|
||||
|
||||
return {
|
||||
tagFormat: 'v${version}',
|
||||
branches: releaseBranches(env),
|
||||
...(url ? { repositoryUrl: url } : {}),
|
||||
plugins: [
|
||||
[
|
||||
'@semantic-release/commit-analyzer',
|
||||
|
|
@ -203,4 +221,5 @@ module.exports = {
|
|||
releaseBranches,
|
||||
releaseKind,
|
||||
releaseTag,
|
||||
repositoryUrl,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue