mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-20 10:36:37 +08:00
fix: add PAT token
This commit is contained in:
parent
5a0a075d0c
commit
6cfa4c59f6
10
.github/workflows/sync-upstream.yml
vendored
10
.github/workflows/sync-upstream.yml
vendored
@ -11,17 +11,19 @@ jobs:
|
||||
permissions: # 添加必要的权限
|
||||
pull-requests: write
|
||||
contents: write
|
||||
workflows: write # 添加 workflows 权限
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # 获取完整历史
|
||||
token: ${{ secrets.PAT_TOKEN }} # 使用PAT以便推送分支
|
||||
|
||||
- name: Sync upstream pull requests
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
token: ${{ secrets.PAT_TOKEN }}
|
||||
# github-token: ${{ secrets.PAT_TOKEN }}
|
||||
script: |
|
||||
const upstream = 'songquanpeng/one-api';
|
||||
const [owner, repo] = upstream.split('/');
|
||||
@ -45,7 +47,7 @@ jobs:
|
||||
page++;
|
||||
}
|
||||
return allPulls;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取所有PR
|
||||
const pulls = await getAllPRs();
|
||||
@ -71,7 +73,7 @@ jobs:
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
head: `${context.repo.owner}:${branchName}`,
|
||||
});
|
||||
});
|
||||
|
||||
if (existingPulls.data.length === 0) {
|
||||
// 推送分支
|
||||
|
Loading…
Reference in New Issue
Block a user