mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-13 11:53:42 +08:00
fix: sync upstream
This commit is contained in:
5
.github/workflows/sync-upstream.yml
vendored
5
.github/workflows/sync-upstream.yml
vendored
@@ -68,12 +68,13 @@ jobs:
|
|||||||
// 创建新分支
|
// 创建新分支
|
||||||
await exec.exec('git', ['fetch', `https://github.com/${owner}/${repo}.git`, `pull/${pull.number}/head:${branchName}`]);
|
await exec.exec('git', ['fetch', `https://github.com/${owner}/${repo}.git`, `pull/${pull.number}/head:${branchName}`]);
|
||||||
|
|
||||||
// 检查是否已存在相同的PR
|
// 检查是否已存在相同的PR(包括已关闭的)
|
||||||
const existingPulls = await github.rest.pulls.list({
|
const existingPulls = await github.rest.pulls.list({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
head: `${context.repo.owner}:${branchName}`,
|
head: `${context.repo.owner}:${branchName}`,
|
||||||
});
|
state: 'all' // 检查所有状态的PR,包括open和closed
|
||||||
|
});
|
||||||
|
|
||||||
if (existingPulls.data.length === 0) {
|
if (existingPulls.data.length === 0) {
|
||||||
// 推送分支
|
// 推送分支
|
||||||
|
|||||||
Reference in New Issue
Block a user