feat: add updateRepoInfo method to Repo class and implement build configuration

- Introduced `updateRepoInfo` method in the `Repo` class to allow updating repository information such as description, license, site, and topics.
- Updated test cases to demonstrate the usage of the new `updateRepoInfo` method.
- Modified build script to include a configuration for triggering builds with specific events and environment variables.
- Commented out previous repository list fetching code in tests for clarity.
This commit is contained in:
xiongxiao
2026-02-09 00:26:54 +08:00
committed by cnb
parent 183c0d5b77
commit 02a4b86338
5 changed files with 627 additions and 43 deletions

View File

@@ -95,11 +95,21 @@ export class Repo extends CNBCore {
page: params.page || 1,
page_size: params.page_size || 999,
}
if(!_params.search) {
if (!_params.search) {
delete _params.search;
}
return this.get({ url, params: _params });
}
updateRepoInfo(repo: string, params: UpdateRepoInfo): Promise<any> {
const url = `/${repo}`;
return this.patch({ url, data: params });
}
}
type UpdateRepoInfo = {
description?: string;
license?: 'MIT' | 'Apache-2.0' | 'GPL-3.0' | 'Unlicense';
site?: string;
topics?: string[];
}
type CreateRepoData = {