diff --git a/.github/workflows/test-tdesign-vue.yaml b/.github/workflows/test-tdesign-vue.yaml new file mode 100644 index 0000000..51f70cb --- /dev/null +++ b/.github/workflows/test-tdesign-vue.yaml @@ -0,0 +1,23 @@ +name: test-tdesign-vue +on: + pull_request: + branches: [develop] + +jobs: + update-snapshot: + # if: contains(github.event.pull_request.labels.*.name, 'vue:/update-snapshot') || contains(github.event.pull_request.labels.*.name, 'test-tdesign-icons') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + - name: test + uses: ./ + id: test + with: + owner: Tencent + repo: tdesign-vue + pr_number: 3473 + trigger: /update-snapshot + token: ${{ secrets.TDESIGN_BOT_TOKEN }} diff --git a/action.yml b/action.yml index 26d5a71..58f1773 100644 --- a/action.yml +++ b/action.yml @@ -15,8 +15,8 @@ inputs: description: trigger required: false token: - description: token - required: false + description: personal access token + required: true runs: using: node20 diff --git a/dist/index.js b/dist/index.js index 323ba85..ce2881e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29928,7 +29928,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.run = run; const node_fs_1 = __nccwpck_require__(3024); const node_path_1 = __nccwpck_require__(6760); -const node_process_1 = __importDefault(__nccwpck_require__(1708)); const core_1 = __nccwpck_require__(9999); const github_1 = __nccwpck_require__(2819); const utils_1 = __nccwpck_require__(6236); @@ -29939,8 +29938,9 @@ function run() { const repo = (0, core_1.getInput)('repo') || github_1.context.repo.repo; const owner = (0, core_1.getInput)('owner') || github_1.context.repo.owner; const pr_number = (0, core_1.getInput)('pr_number') || github_1.context.issue.number; - const token = (0, core_1.getInput)('token') || node_process_1.default.env.GITHUB_TOKEN || ''; + const token = (0, core_1.getInput)('token', { required: true }); const trigger = (0, core_1.getInput)('trigger') || ((_a = github_1.context.payload.comment) === null || _a === void 0 ? void 0 : _a.body) || ''; + (0, core_1.info)(`context:${JSON.stringify(github_1.context, null, 2)}`); if (github_1.context.eventName === 'issue_comment' && github_1.context.payload.pull_request) { (0, core_1.info)('pr comment trigger'); const whitelist = (0, node_fs_1.readFileSync)((0, node_path_1.resolve)(__dirname, '../.comment-trigger-whitelist'), 'utf-8'); @@ -29958,7 +29958,7 @@ function run() { return; } } - yield (0, utils_1.setGitConfig)(); + yield (0, utils_1.setGitGlobalConfig)(token); (0, trigger_1.default)({ owner, repo, @@ -30139,6 +30139,101 @@ function start(context) { ; +/***/ }), + +/***/ 5412: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports["default"] = run; +const core_1 = __nccwpck_require__(9999); +const exec_1 = __nccwpck_require__(8872); +const git_1 = __importDefault(__nccwpck_require__(8511)); +const github_1 = __importDefault(__nccwpck_require__(9764)); +const supportTrigger = ['/update-common', '/update-snapshot']; +function run(context) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b; + if (!supportTrigger.includes(context.trigger)) { + (0, core_1.error)(`${context.repo} 不支持 ${context.trigger} `); + } + const { getPrData } = (0, github_1.default)({ repo: context.repo, owner: context.owner, token: context.token }); + const prData = yield getPrData(context.pr_number); + (0, core_1.info)(`getPrData:${JSON.stringify(prData, null, 2)}`); + if (!prData.maintainer_can_modify) { + (0, core_1.error)(`pr:${context.pr_number} 不允许维护者修改`); + } + if (prData.state !== 'open') { + (0, core_1.error)(`pr:${context.pr_number} 不是 open 状态`); + } + let isForkPr = false; + if (prData.head.user.login !== context.owner) { + isForkPr = true; + (0, core_1.info)(`pr:${context.pr_number} 是 fork pr`); + } + const branchName = prData.head.ref; + const { cloneRepo, initSubmodule, checkoutBranch, checkoutPr, addRemote, isNeedCommit } = (0, git_1.default)({ + repo: context.repo, + owner: context.owner, + token: context.token, + }); + yield cloneRepo(); + if (isForkPr) { + // 检出PR分支 + // git fetch origin pull//head:<自定义分支名> + // git fetch origin pull/7/head:pr-7 + // 设置PR 仓库源 + // git add remote + // git add remote liweijie812 https://github.com/liweijie0812/tdesign-vue + // git fetch liweijie812 + // PR分支与远程分支建立关联 + // git branch --set-upstream-to / <本地分支名> + // git branch --set-upstream-to refs/remotes/liweijie812/feat/new pr-7 + yield addRemote(prData.head.user.login, ((_b = (_a = prData.head) === null || _a === void 0 ? void 0 : _a.repo) === null || _b === void 0 ? void 0 : _b.clone_url) || ''); + yield checkoutPr(context.pr_number); + yield (0, exec_1.exec)('git', [ + 'branch', + '--set-upstream-to', + `refs/remotes/${prData.head.user.login}/${prData.head.ref}`, + `pr-${context.pr_number}`, + ], { cwd: `../${context.repo}` }); + } + else { + yield checkoutBranch(branchName); + } + yield initSubmodule(); + yield (0, exec_1.exec)('npm', ['install'], { cwd: `../${context.repo}` }); + yield (0, exec_1.exec)('npm', ['run', 'test:update'], { cwd: `../${context.repo}` }); + yield (0, exec_1.exec)('git', ['status'], { cwd: `../${context.repo}` }); + if (!(yield isNeedCommit())) { + (0, core_1.info)('无需提交'); + return true; + } + yield (0, exec_1.exec)('git', ['commit', '-am', 'chore: update snapshot'], { cwd: `../${context.repo}` }); + if (isForkPr) { + yield (0, exec_1.exec)('git', ['push', prData.head.user.login, `HEAD:${prData.head.ref}`], { cwd: `../${context.repo}` }); + } + else { + yield (0, exec_1.exec)('git', ['push', 'origin', branchName], { cwd: `../${context.repo}` }); + } + }); +} + + /***/ }), /***/ 6236: @@ -30163,10 +30258,13 @@ exports.getPrData = getPrData; exports.createPR = createPR; exports.getPkgLatestVersion = getPkgLatestVersion; exports.bumpIconsVersion = bumpIconsVersion; -exports.setGitConfig = setGitConfig; +exports.setGitGlobalConfig = setGitGlobalConfig; exports.createBranch = createBranch; exports.gitCommit = gitCommit; exports.gitPush = gitPush; +exports.sshConfig = sshConfig; +const node_fs_1 = __nccwpck_require__(3024); +const node_process_1 = __nccwpck_require__(1708); const core_1 = __nccwpck_require__(9999); const exec_1 = __nccwpck_require__(8872); const github_1 = __nccwpck_require__(2819); @@ -30240,10 +30338,11 @@ function bumpIconsVersion(repo) { yield (0, exec_1.exec)('git', ['status'], { cwd: `../${repo}` }); }); } -function setGitConfig() { +function setGitGlobalConfig(token) { return __awaiter(this, void 0, void 0, function* () { yield (0, exec_1.exec)(`git config --global user.email "tdesign@tencent.com"`); yield (0, exec_1.exec)(`git config --global user.name "tdesign-bot"`); + yield (0, exec_1.exec)('git', ['config', '--global', `url.https://${token}@github.com/.insteadOf`, 'https://github.com/']); }); } function createBranch(repo, branch) { @@ -30262,6 +30361,16 @@ function gitPush(repo, branch) { yield (0, exec_1.exec)(`git push origin ${branch}`, [], { cwd: `../${repo}` }); }); } +function sshConfig(token) { + return __awaiter(this, void 0, void 0, function* () { + const homePath = node_process_1.env.HOME || '/home/runner'; + const sshPath = `${homePath}/.ssh`; + (0, node_fs_1.mkdirSync)(`${sshPath}`, { mode: 0o700 }); + (0, node_fs_1.writeFileSync)(`${sshPath}/id_rsa`, token, { mode: 0o600 }); + yield (0, exec_1.exec)('ls', ['-al', sshPath]); + yield (0, exec_1.exec)(`ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts`); + }); +} /***/ }), @@ -30286,7 +30395,8 @@ const exec_1 = __nccwpck_require__(8872); function useGit(context) { function cloneRepo() { return __awaiter(this, arguments, void 0, function* (branchName = 'develop') { - const repo_url = `https://${context.token}@github.com/${context.owner}/${context.repo}.git`; + // const repo_url = `https://${context.token}@github.com/${context.owner}/${context.repo}.git` + const repo_url = `https://github.com/${context.owner}/${context.repo}.git`; yield (0, exec_1.exec)('git', ['clone', '-b', branchName, repo_url, `../${context.repo}`]); }); } @@ -30295,6 +30405,17 @@ function useGit(context) { yield (0, exec_1.exec)('git', ['checkout', '-b', branch], { cwd: `../${context.repo}` }); }); } + function checkoutBranch(branch) { + return __awaiter(this, void 0, void 0, function* () { + yield (0, exec_1.exec)('git', ['checkout', branch], { cwd: `../${context.repo}` }); + }); + } + function checkoutPr(pr_number) { + return __awaiter(this, void 0, void 0, function* () { + yield (0, exec_1.exec)('git', ['fetch', 'origin', `pull/${pr_number}/head:pr-${pr_number}`], { cwd: `../${context.repo}` }); + yield (0, exec_1.exec)('git', ['checkout', `pr-${pr_number}`], { cwd: `../${context.repo}` }); + }); + } function gitCommit(message) { return __awaiter(this, void 0, void 0, function* () { yield (0, exec_1.exec)(`git commit -am "${message}" --no-verify`, [], { cwd: `../${context.repo}` }); @@ -30321,7 +30442,14 @@ function useGit(context) { return !stdout.includes('nothing to commit, working tree clean'); }); } + function addRemote(origin, gitUrl) { + return __awaiter(this, void 0, void 0, function* () { + yield (0, exec_1.exec)('git', ['remote', 'add', origin, gitUrl], { cwd: `../${context.repo}` }); + yield (0, exec_1.exec)('git', ['fetch', origin], { cwd: `../${context.repo}` }); + }); + } return { + checkoutPr, cloneRepo, createBranch, gitCommit, @@ -30329,6 +30457,8 @@ function useGit(context) { initSubmodule, updateSubmodule, isNeedCommit, + checkoutBranch, + addRemote, }; } @@ -30409,8 +30539,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ownerMap = exports.repoMap = exports.iconsMap = void 0; exports["default"] = useTrigger; +const core_1 = __nccwpck_require__(9999); const common_1 = __importDefault(__nccwpck_require__(5327)); const icons_1 = __importDefault(__nccwpck_require__(8862)); +const vue_1 = __importDefault(__nccwpck_require__(5412)); exports.iconsMap = { '/pr-vue': 'tdesign-icons-vue', '/pr-vue-next': 'tdesign-icons-vue-next', @@ -30438,16 +30570,15 @@ exports.ownerMap = { '/pr-flutter': 'Tencent', }; function useTrigger(context) { - // TODO switch (context.repo) { case 'tdesign-icons': - (0, icons_1.default)(context); - break; + return (0, common_1.default)(context); case 'tdesign-common': - (0, common_1.default)(context); - break; + return (0, icons_1.default)(context); + case 'tdesign-vue': + return (0, vue_1.default)(context); default: - throw new Error(`不支持的仓库: ${context.repo}`); + (0, core_1.error)(`${context.repo} 未适配`); } } diff --git a/src/index.ts b/src/index.ts index 131ecb9..f48d8d8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,18 +1,17 @@ import { readFileSync } from 'node:fs' import { resolve } from 'node:path' -import process from 'node:process' import { getInput, info } from '@actions/core' import { context } from '@actions/github' -import { setGitConfig } from './utils' +import { setGitGlobalConfig } from './utils' import useTrigger from './utils/trigger' export async function run(): Promise { const repo = getInput('repo') || context.repo.repo const owner = getInput('owner') || context.repo.owner const pr_number = getInput('pr_number') || context.issue.number - const token = getInput('token') || process.env.GITHUB_TOKEN || '' + const token = getInput('token', { required: true }) const trigger = getInput('trigger') || context.payload.comment?.body || '' - + info(`context:${JSON.stringify(context, null, 2)}`) if (context.eventName === 'issue_comment' && context.payload.pull_request) { info('pr comment trigger') const whitelist = readFileSync(resolve(__dirname, '../.comment-trigger-whitelist'), 'utf-8') @@ -31,7 +30,7 @@ export async function run(): Promise { } } - await setGitConfig() + await setGitGlobalConfig(token) useTrigger({ owner, diff --git a/src/tdesign/vue.ts b/src/tdesign/vue.ts index e69de29..c4efa59 100644 --- a/src/tdesign/vue.ts +++ b/src/tdesign/vue.ts @@ -0,0 +1,75 @@ +import type { TriggerContext } from '../utils/trigger' +import { error, info } from '@actions/core' +import { exec } from '@actions/exec' +import useGit from 'src/utils/git' + +import useGithub from 'src/utils/github' + +const supportTrigger = ['/update-common', '/update-snapshot'] +export default async function run(context: TriggerContext) { + if (!supportTrigger.includes(context.trigger)) { + error(`${context.repo} 不支持 ${context.trigger} `) + } + const { getPrData } = useGithub({ repo: context.repo, owner: context.owner, token: context.token }) + const prData = await getPrData(context.pr_number) + info(`getPrData:${JSON.stringify(prData, null, 2)}`) + if (!prData.maintainer_can_modify) { + error(`pr:${context.pr_number} 不允许维护者修改`) + } + if (prData.state !== 'open') { + error(`pr:${context.pr_number} 不是 open 状态`) + } + + let isForkPr = false + if (prData.head.user.login !== context.owner) { + isForkPr = true + info(`pr:${context.pr_number} 是 fork pr`) + } + const branchName = prData.head.ref + + const { cloneRepo, initSubmodule, checkoutBranch, checkoutPr, addRemote, isNeedCommit } = useGit({ + repo: context.repo, + owner: context.owner, + token: context.token, + }) + await cloneRepo() + + if (isForkPr) { + // 检出PR分支 + // git fetch origin pull//head:<自定义分支名> + // git fetch origin pull/7/head:pr-7 + // 设置PR 仓库源 + // git add remote + // git add remote liweijie812 https://github.com/liweijie0812/tdesign-vue + // git fetch liweijie812 + // PR分支与远程分支建立关联 + // git branch --set-upstream-to / <本地分支名> + // git branch --set-upstream-to refs/remotes/liweijie812/feat/new pr-7 + await addRemote(prData.head.user.login, prData.head?.repo?.clone_url || '') + await checkoutPr(context.pr_number) + await exec('git', [ + 'branch', + '--set-upstream-to', + `refs/remotes/${prData.head.user.login}/${prData.head.ref}`, + `pr-${context.pr_number}`, + ], { cwd: `../${context.repo}` }) + } + else { + await checkoutBranch(branchName) + } + await initSubmodule() + await exec('npm', ['install'], { cwd: `../${context.repo}` }) + await exec('npm', ['run', 'test:update'], { cwd: `../${context.repo}` }) + await exec('git', ['status'], { cwd: `../${context.repo}` }) + if (!await isNeedCommit()) { + info('无需提交') + return true + } + await exec('git', ['commit', '-am', 'chore: update snapshot'], { cwd: `../${context.repo}` }) + if (isForkPr) { + await exec('git', ['push', prData.head.user.login, `HEAD:${prData.head.ref}`], { cwd: `../${context.repo}` }) + } + else { + await exec('git', ['push', 'origin', branchName], { cwd: `../${context.repo}` }) + } +} diff --git a/src/utils.ts b/src/utils.ts index e88b134..a9263ed 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,3 +1,5 @@ +import { mkdirSync, writeFileSync } from 'node:fs' +import { env } from 'node:process' import { info } from '@actions/core' import { exec, getExecOutput } from '@actions/exec' import { getOctokit } from '@actions/github' @@ -76,9 +78,10 @@ export async function bumpIconsVersion(repo: string) { await exec('git', ['status'], { cwd: `../${repo}` }) } -export async function setGitConfig() { +export async function setGitGlobalConfig(token: string) { await exec(`git config --global user.email "tdesign@tencent.com"`) await exec(`git config --global user.name "tdesign-bot"`) + await exec('git', ['config', '--global', `url.https://${token}@github.com/.insteadOf`, 'https://github.com/']) } export async function createBranch(repo: string, branch: string) { @@ -93,3 +96,12 @@ export async function gitCommit(repo: string, message: string) { export async function gitPush(repo: string, branch: string) { await exec(`git push origin ${branch}`, [], { cwd: `../${repo}` }) } + +export async function sshConfig(token: string) { + const homePath = env.HOME || '/home/runner' + const sshPath = `${homePath}/.ssh` + mkdirSync(`${sshPath}`, { mode: 0o700 }) + writeFileSync(`${sshPath}/id_rsa`, token, { mode: 0o600 }) + await exec('ls', ['-al', sshPath]) + await exec(`ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts`) +} diff --git a/src/utils/git.ts b/src/utils/git.ts index c5e0492..34d8b64 100644 --- a/src/utils/git.ts +++ b/src/utils/git.ts @@ -7,12 +7,21 @@ export interface GitContext { } export default function useGit(context: GitContext) { async function cloneRepo(branchName = 'develop') { - const repo_url = `https://${context.token}@github.com/${context.owner}/${context.repo}.git` + // const repo_url = `https://${context.token}@github.com/${context.owner}/${context.repo}.git` + const repo_url = `https://github.com/${context.owner}/${context.repo}.git` await exec('git', ['clone', '-b', branchName, repo_url, `../${context.repo}`]) } async function createBranch(branch: string) { await exec('git', ['checkout', '-b', branch], { cwd: `../${context.repo}` }) } + + async function checkoutBranch(branch: string) { + await exec('git', ['checkout', branch], { cwd: `../${context.repo}` }) + } + async function checkoutPr(pr_number: number) { + await exec('git', ['fetch', 'origin', `pull/${pr_number}/head:pr-${pr_number}`], { cwd: `../${context.repo}` }) + await exec('git', ['checkout', `pr-${pr_number}`], { cwd: `../${context.repo}` }) + } async function gitCommit(message: string) { await exec(`git commit -am "${message}" --no-verify`, [], { cwd: `../${context.repo}` }) } @@ -32,8 +41,13 @@ export default function useGit(context: GitContext) { const { stdout } = await getExecOutput('git', ['status'], { cwd: `../${context.repo}` }) return !stdout.includes('nothing to commit, working tree clean') } + async function addRemote(origin: string, gitUrl: string) { + await exec('git', ['remote', 'add', origin, gitUrl], { cwd: `../${context.repo}` }) + await exec('git', ['fetch', origin], { cwd: `../${context.repo}` }) + } return { + checkoutPr, cloneRepo, createBranch, gitCommit, @@ -41,5 +55,7 @@ export default function useGit(context: GitContext) { initSubmodule, updateSubmodule, isNeedCommit, + checkoutBranch, + addRemote, } } diff --git a/src/utils/trigger.ts b/src/utils/trigger.ts index f19b838..dabc757 100644 --- a/src/utils/trigger.ts +++ b/src/utils/trigger.ts @@ -1,5 +1,7 @@ -import commonStart from '../tdesign/common' -import iconStart from '../tdesign/icons' +import { error } from '@actions/core' +import common from '../tdesign/common' +import icons from '../tdesign/icons' +import vue from '../tdesign/vue' export const iconsMap = { '/pr-vue': 'tdesign-icons-vue', @@ -36,15 +38,14 @@ export interface TriggerContext { trigger: string } export default function useTrigger(context: TriggerContext) { - // TODO switch (context.repo) { case 'tdesign-icons': - iconStart(context) - break + return common(context) case 'tdesign-common': - commonStart(context) - break + return icons(context) + case 'tdesign-vue': + return vue(context) default: - throw new Error(`不支持的仓库: ${context.repo}`) + error(`${context.repo} 未适配`) } } diff --git a/test/fixtures/tesign-vue-fork-pr-data.json b/test/fixtures/tesign-vue-fork-pr-data.json new file mode 100644 index 0000000..51c96a1 --- /dev/null +++ b/test/fixtures/tesign-vue-fork-pr-data.json @@ -0,0 +1,471 @@ +{ + "url": "https://api.github.com/repos/Tencent/tdesign-vue/pulls/3473", + "id": 2285334331, + "node_id": "PR_kwDOGWCrmM6IN287", + "html_url": "https://github.com/Tencent/tdesign-vue/pull/3473", + "diff_url": "https://github.com/Tencent/tdesign-vue/pull/3473.diff", + "patch_url": "https://github.com/Tencent/tdesign-vue/pull/3473.patch", + "issue_url": "https://api.github.com/repos/Tencent/tdesign-vue/issues/3473", + "number": 3473, + "state": "open", + "locked": false, + "title": "[ignore]ci: test", + "user": { + "login": "liweijie0812", + "id": 10710889, + "node_id": "MDQ6VXNlcjEwNzEwODg5", + "avatar_url": "https://avatars.githubusercontent.com/u/10710889?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/liweijie0812", + "html_url": "https://github.com/liweijie0812", + "followers_url": "https://api.github.com/users/liweijie0812/followers", + "following_url": "https://api.github.com/users/liweijie0812/following{/other_user}", + "gists_url": "https://api.github.com/users/liweijie0812/gists{/gist_id}", + "starred_url": "https://api.github.com/users/liweijie0812/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/liweijie0812/subscriptions", + "organizations_url": "https://api.github.com/users/liweijie0812/orgs", + "repos_url": "https://api.github.com/users/liweijie0812/repos", + "events_url": "https://api.github.com/users/liweijie0812/events{/privacy}", + "received_events_url": "https://api.github.com/users/liweijie0812/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "body": "\r\n\r\n### 🤔 这个 PR 的性质是?\r\n\r\n- [ ] 日常 bug 修复\r\n- [ ] 新特性提交\r\n- [ ] 文档改进\r\n- [ ] 演示代码改进\r\n- [ ] 组件样式/交互改进\r\n- [ ] CI/CD 改进\r\n- [ ] 重构\r\n- [ ] 代码风格优化\r\n- [ ] 测试用例\r\n- [ ] 分支合并\r\n- [ ] 其他\r\n\r\n### 🔗 相关 Issue\r\n\r\n\r\n\r\n### 💡 需求背景和解决方案\r\n\r\n\r\n\r\n### 📝 更新日志\r\n\r\n\r\n\r\n- fix(组件名称): 处理问题或特性描述 ...\r\n\r\n- [ ] 本条 PR 不需要纳入 Changelog\r\n\r\n### ☑️ 请求合并前的自查清单\r\n\r\n⚠️ 请自检并全部**勾选全部选项**。⚠️\r\n\r\n- [ ] 文档已补充或无须补充\r\n- [ ] 代码演示已提供或无须提供\r\n- [ ] TypeScript 定义已补充或无须补充\r\n- [ ] Changelog 已提供或无须提供\r\n", + "created_at": "2025-01-18T03:09:52Z", + "updated_at": "2025-01-18T03:15:30Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "b28c6536057afd82eb5f3be62e8680a1c9688ce5", + "assignee": null, + "assignees": [], + "requested_reviewers": [ + { + "login": "xiaosansiji", + "id": 7600149, + "node_id": "MDQ6VXNlcjc2MDAxNDk=", + "avatar_url": "https://avatars.githubusercontent.com/u/7600149?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/xiaosansiji", + "html_url": "https://github.com/xiaosansiji", + "followers_url": "https://api.github.com/users/xiaosansiji/followers", + "following_url": "https://api.github.com/users/xiaosansiji/following{/other_user}", + "gists_url": "https://api.github.com/users/xiaosansiji/gists{/gist_id}", + "starred_url": "https://api.github.com/users/xiaosansiji/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/xiaosansiji/subscriptions", + "organizations_url": "https://api.github.com/users/xiaosansiji/orgs", + "repos_url": "https://api.github.com/users/xiaosansiji/repos", + "events_url": "https://api.github.com/users/xiaosansiji/events{/privacy}", + "received_events_url": "https://api.github.com/users/xiaosansiji/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + { + "login": "chaishi", + "id": 11605702, + "node_id": "MDQ6VXNlcjExNjA1NzAy", + "avatar_url": "https://avatars.githubusercontent.com/u/11605702?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/chaishi", + "html_url": "https://github.com/chaishi", + "followers_url": "https://api.github.com/users/chaishi/followers", + "following_url": "https://api.github.com/users/chaishi/following{/other_user}", + "gists_url": "https://api.github.com/users/chaishi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/chaishi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/chaishi/subscriptions", + "organizations_url": "https://api.github.com/users/chaishi/orgs", + "repos_url": "https://api.github.com/users/chaishi/repos", + "events_url": "https://api.github.com/users/chaishi/events{/privacy}", + "received_events_url": "https://api.github.com/users/chaishi/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + { + "login": "LoopZhou", + "id": 13745660, + "node_id": "MDQ6VXNlcjEzNzQ1NjYw", + "avatar_url": "https://avatars.githubusercontent.com/u/13745660?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/LoopZhou", + "html_url": "https://github.com/LoopZhou", + "followers_url": "https://api.github.com/users/LoopZhou/followers", + "following_url": "https://api.github.com/users/LoopZhou/following{/other_user}", + "gists_url": "https://api.github.com/users/LoopZhou/gists{/gist_id}", + "starred_url": "https://api.github.com/users/LoopZhou/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/LoopZhou/subscriptions", + "organizations_url": "https://api.github.com/users/LoopZhou/orgs", + "repos_url": "https://api.github.com/users/LoopZhou/repos", + "events_url": "https://api.github.com/users/LoopZhou/events{/privacy}", + "received_events_url": "https://api.github.com/users/LoopZhou/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + { + "login": "uyarn", + "id": 26377630, + "node_id": "MDQ6VXNlcjI2Mzc3NjMw", + "avatar_url": "https://avatars.githubusercontent.com/u/26377630?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/uyarn", + "html_url": "https://github.com/uyarn", + "followers_url": "https://api.github.com/users/uyarn/followers", + "following_url": "https://api.github.com/users/uyarn/following{/other_user}", + "gists_url": "https://api.github.com/users/uyarn/gists{/gist_id}", + "starred_url": "https://api.github.com/users/uyarn/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/uyarn/subscriptions", + "organizations_url": "https://api.github.com/users/uyarn/orgs", + "repos_url": "https://api.github.com/users/uyarn/repos", + "events_url": "https://api.github.com/users/uyarn/events{/privacy}", + "received_events_url": "https://api.github.com/users/uyarn/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + { + "login": "maoyiluo", + "id": 43943796, + "node_id": "MDQ6VXNlcjQzOTQzNzk2", + "avatar_url": "https://avatars.githubusercontent.com/u/43943796?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/maoyiluo", + "html_url": "https://github.com/maoyiluo", + "followers_url": "https://api.github.com/users/maoyiluo/followers", + "following_url": "https://api.github.com/users/maoyiluo/following{/other_user}", + "gists_url": "https://api.github.com/users/maoyiluo/gists{/gist_id}", + "starred_url": "https://api.github.com/users/maoyiluo/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/maoyiluo/subscriptions", + "organizations_url": "https://api.github.com/users/maoyiluo/orgs", + "repos_url": "https://api.github.com/users/maoyiluo/repos", + "events_url": "https://api.github.com/users/maoyiluo/events{/privacy}", + "received_events_url": "https://api.github.com/users/maoyiluo/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + } + ], + "requested_teams": [], + "labels": [], + "milestone": null, + "draft": false, + "commits_url": "https://api.github.com/repos/Tencent/tdesign-vue/pulls/3473/commits", + "review_comments_url": "https://api.github.com/repos/Tencent/tdesign-vue/pulls/3473/comments", + "review_comment_url": "https://api.github.com/repos/Tencent/tdesign-vue/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/Tencent/tdesign-vue/issues/3473/comments", + "statuses_url": "https://api.github.com/repos/Tencent/tdesign-vue/statuses/9d40b27c8ff15d5c7c019b28fb037c2e05ed67a9", + "head": { + "label": "liweijie0812:test/ci", + "ref": "test/ci", + "sha": "9d40b27c8ff15d5c7c019b28fb037c2e05ed67a9", + "user": { + "login": "liweijie0812", + "id": 10710889, + "node_id": "MDQ6VXNlcjEwNzEwODg5", + "avatar_url": "https://avatars.githubusercontent.com/u/10710889?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/liweijie0812", + "html_url": "https://github.com/liweijie0812", + "followers_url": "https://api.github.com/users/liweijie0812/followers", + "following_url": "https://api.github.com/users/liweijie0812/following{/other_user}", + "gists_url": "https://api.github.com/users/liweijie0812/gists{/gist_id}", + "starred_url": "https://api.github.com/users/liweijie0812/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/liweijie0812/subscriptions", + "organizations_url": "https://api.github.com/users/liweijie0812/orgs", + "repos_url": "https://api.github.com/users/liweijie0812/repos", + "events_url": "https://api.github.com/users/liweijie0812/events{/privacy}", + "received_events_url": "https://api.github.com/users/liweijie0812/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "repo": { + "id": 659646096, + "node_id": "R_kgDOJ1FmkA", + "name": "tdesign-vue", + "full_name": "liweijie0812/tdesign-vue", + "private": false, + "owner": { + "login": "liweijie0812", + "id": 10710889, + "node_id": "MDQ6VXNlcjEwNzEwODg5", + "avatar_url": "https://avatars.githubusercontent.com/u/10710889?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/liweijie0812", + "html_url": "https://github.com/liweijie0812", + "followers_url": "https://api.github.com/users/liweijie0812/followers", + "following_url": "https://api.github.com/users/liweijie0812/following{/other_user}", + "gists_url": "https://api.github.com/users/liweijie0812/gists{/gist_id}", + "starred_url": "https://api.github.com/users/liweijie0812/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/liweijie0812/subscriptions", + "organizations_url": "https://api.github.com/users/liweijie0812/orgs", + "repos_url": "https://api.github.com/users/liweijie0812/repos", + "events_url": "https://api.github.com/users/liweijie0812/events{/privacy}", + "received_events_url": "https://api.github.com/users/liweijie0812/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/liweijie0812/tdesign-vue", + "description": "A Vue.js UI components lib for TDesign.", + "fork": true, + "url": "https://api.github.com/repos/liweijie0812/tdesign-vue", + "forks_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/forks", + "keys_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/teams", + "hooks_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/hooks", + "issue_events_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/issues/events{/number}", + "events_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/events", + "assignees_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/assignees{/user}", + "branches_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/branches{/branch}", + "tags_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/tags", + "blobs_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/statuses/{sha}", + "languages_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/languages", + "stargazers_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/stargazers", + "contributors_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/contributors", + "subscribers_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/subscribers", + "subscription_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/subscription", + "commits_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/contents/{+path}", + "compare_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/merges", + "archive_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/downloads", + "issues_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/issues{/number}", + "pulls_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/pulls{/number}", + "milestones_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/milestones{/number}", + "notifications_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/labels{/name}", + "releases_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/releases{/id}", + "deployments_url": "https://api.github.com/repos/liweijie0812/tdesign-vue/deployments", + "created_at": "2023-06-28T09:06:08Z", + "updated_at": "2024-09-11T06:36:52Z", + "pushed_at": "2025-01-18T03:09:10Z", + "git_url": "git://github.com/liweijie0812/tdesign-vue.git", + "ssh_url": "git@github.com:liweijie0812/tdesign-vue.git", + "clone_url": "https://github.com/liweijie0812/tdesign-vue.git", + "svn_url": "https://github.com/liweijie0812/tdesign-vue", + "homepage": "https://tdesign.tencent.com/vue", + "size": 31342, + "stargazers_count": 0, + "watchers_count": 0, + "language": "TypeScript", + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 1, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 0, + "open_issues": 1, + "watchers": 0, + "default_branch": "develop" + } + }, + "base": { + "label": "Tencent:develop", + "ref": "develop", + "sha": "fba353b9c248aab524ea7baaa3f7b4da9ae1f437", + "user": { + "login": "Tencent", + "id": 18461506, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjE4NDYxNTA2", + "avatar_url": "https://avatars.githubusercontent.com/u/18461506?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Tencent", + "html_url": "https://github.com/Tencent", + "followers_url": "https://api.github.com/users/Tencent/followers", + "following_url": "https://api.github.com/users/Tencent/following{/other_user}", + "gists_url": "https://api.github.com/users/Tencent/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Tencent/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Tencent/subscriptions", + "organizations_url": "https://api.github.com/users/Tencent/orgs", + "repos_url": "https://api.github.com/users/Tencent/repos", + "events_url": "https://api.github.com/users/Tencent/events{/privacy}", + "received_events_url": "https://api.github.com/users/Tencent/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "repo": { + "id": 425765784, + "node_id": "R_kgDOGWCrmA", + "name": "tdesign-vue", + "full_name": "Tencent/tdesign-vue", + "private": false, + "owner": { + "login": "Tencent", + "id": 18461506, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjE4NDYxNTA2", + "avatar_url": "https://avatars.githubusercontent.com/u/18461506?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Tencent", + "html_url": "https://github.com/Tencent", + "followers_url": "https://api.github.com/users/Tencent/followers", + "following_url": "https://api.github.com/users/Tencent/following{/other_user}", + "gists_url": "https://api.github.com/users/Tencent/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Tencent/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Tencent/subscriptions", + "organizations_url": "https://api.github.com/users/Tencent/orgs", + "repos_url": "https://api.github.com/users/Tencent/repos", + "events_url": "https://api.github.com/users/Tencent/events{/privacy}", + "received_events_url": "https://api.github.com/users/Tencent/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/Tencent/tdesign-vue", + "description": "A Vue.js UI components lib for TDesign.", + "fork": false, + "url": "https://api.github.com/repos/Tencent/tdesign-vue", + "forks_url": "https://api.github.com/repos/Tencent/tdesign-vue/forks", + "keys_url": "https://api.github.com/repos/Tencent/tdesign-vue/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/Tencent/tdesign-vue/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/Tencent/tdesign-vue/teams", + "hooks_url": "https://api.github.com/repos/Tencent/tdesign-vue/hooks", + "issue_events_url": "https://api.github.com/repos/Tencent/tdesign-vue/issues/events{/number}", + "events_url": "https://api.github.com/repos/Tencent/tdesign-vue/events", + "assignees_url": "https://api.github.com/repos/Tencent/tdesign-vue/assignees{/user}", + "branches_url": "https://api.github.com/repos/Tencent/tdesign-vue/branches{/branch}", + "tags_url": "https://api.github.com/repos/Tencent/tdesign-vue/tags", + "blobs_url": "https://api.github.com/repos/Tencent/tdesign-vue/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/Tencent/tdesign-vue/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/Tencent/tdesign-vue/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/Tencent/tdesign-vue/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/Tencent/tdesign-vue/statuses/{sha}", + "languages_url": "https://api.github.com/repos/Tencent/tdesign-vue/languages", + "stargazers_url": "https://api.github.com/repos/Tencent/tdesign-vue/stargazers", + "contributors_url": "https://api.github.com/repos/Tencent/tdesign-vue/contributors", + "subscribers_url": "https://api.github.com/repos/Tencent/tdesign-vue/subscribers", + "subscription_url": "https://api.github.com/repos/Tencent/tdesign-vue/subscription", + "commits_url": "https://api.github.com/repos/Tencent/tdesign-vue/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/Tencent/tdesign-vue/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/Tencent/tdesign-vue/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/Tencent/tdesign-vue/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/Tencent/tdesign-vue/contents/{+path}", + "compare_url": "https://api.github.com/repos/Tencent/tdesign-vue/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/Tencent/tdesign-vue/merges", + "archive_url": "https://api.github.com/repos/Tencent/tdesign-vue/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/Tencent/tdesign-vue/downloads", + "issues_url": "https://api.github.com/repos/Tencent/tdesign-vue/issues{/number}", + "pulls_url": "https://api.github.com/repos/Tencent/tdesign-vue/pulls{/number}", + "milestones_url": "https://api.github.com/repos/Tencent/tdesign-vue/milestones{/number}", + "notifications_url": "https://api.github.com/repos/Tencent/tdesign-vue/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/Tencent/tdesign-vue/labels{/name}", + "releases_url": "https://api.github.com/repos/Tencent/tdesign-vue/releases{/id}", + "deployments_url": "https://api.github.com/repos/Tencent/tdesign-vue/deployments", + "created_at": "2021-11-08T09:02:24Z", + "updated_at": "2025-01-16T10:18:34Z", + "pushed_at": "2025-01-16T10:18:34Z", + "git_url": "git://github.com/Tencent/tdesign-vue.git", + "ssh_url": "git@github.com:Tencent/tdesign-vue.git", + "clone_url": "https://github.com/Tencent/tdesign-vue.git", + "svn_url": "https://github.com/Tencent/tdesign-vue", + "homepage": "https://tdesign.tencent.com/vue", + "size": 34588, + "stargazers_count": 936, + "watchers_count": 936, + "language": "TypeScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "has_discussions": true, + "forks_count": 363, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 254, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [ + "less", + "pc", + "tdesign", + "tyepscript", + "vue2" + ], + "visibility": "public", + "forks": 363, + "open_issues": 254, + "watchers": 936, + "default_branch": "develop" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/Tencent/tdesign-vue/pulls/3473" + }, + "html": { + "href": "https://github.com/Tencent/tdesign-vue/pull/3473" + }, + "issue": { + "href": "https://api.github.com/repos/Tencent/tdesign-vue/issues/3473" + }, + "comments": { + "href": "https://api.github.com/repos/Tencent/tdesign-vue/issues/3473/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/Tencent/tdesign-vue/pulls/3473/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/Tencent/tdesign-vue/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/Tencent/tdesign-vue/pulls/3473/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/Tencent/tdesign-vue/statuses/9d40b27c8ff15d5c7c019b28fb037c2e05ed67a9" + } + }, + "author_association": "COLLABORATOR", + "auto_merge": null, + "active_lock_reason": null, + "merged": false, + "mergeable": true, + "rebaseable": true, + "mergeable_state": "blocked", + "merged_by": null, + "comments": 1, + "review_comments": 0, + "maintainer_can_modify": true, + "commits": 1, + "additions": 1, + "deletions": 1, + "changed_files": 1 +}