diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 9da1906a..aa47250b 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -55,7 +55,7 @@ jobs: uses: docker/metadata-action@v4 with: images: | - ${{ contains(github.ref, 'alpha') && 'justsong/one-api-alpha' || 'justsong/one-api' }} + ${{ contains(github.ref, 'alpha') && 'Sagit-chu/one-api-alpha' || 'Sagit-chu/one-api' }} ${{ contains(github.ref, 'alpha') && format('ghcr.io/{0}-alpha', github.repository) || format('ghcr.io/{0}', github.repository) }} - name: Build and push Docker images diff --git a/.github/workflows/sync-upstreem-pr.yml b/.github/workflows/sync-upstreem-pr.yml deleted file mode 100644 index 8eaf7a4e..00000000 --- a/.github/workflows/sync-upstreem-pr.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Sync Upstream PRs - -on: - # 每6小时运行一次 - schedule: - - cron: '0 */6 * * *' - # 也可以手动触发 - workflow_dispatch: - -jobs: - sync: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Configure Git - run: | - git config --global user.name 'github-actions' - git config --global user.email 'github-actions@github.com' - - - name: Sync Upstream PRs - env: - GITHUB_TOKEN: ${{ secrets.TOKEN }} - GH_TOKEN: ${{ github.token }} - UPSTREAM_REPO: ${{ secrets.UPSTREAM_REPO }} # 例如 'original-owner/original-repo' - UPSTREAM_OWNER: ${{ secrets.UPSTREAM_OWNER }} # 例如 'original-owner' - UPSTREAM_REPO_NAME: ${{ secrets.UPSTREAM_REPO_NAME }} # 例如 'original-repo' - REPO_OWNER: ${{ github.repository_owner }} - REPO_NAME: ${{ github.event.repository.name }} - run: | - # 获取上游仓库的PR列表 - upstream_prs=$(gh api repos/$UPSTREAM_REPO/pulls -q '.[] | {number: .number, title: .title, head: .head.ref, base: .base.ref, state: .state, draft: .draft} | select(.state == "open" and .draft == false)') - - # 获取本仓库的PR列表 - local_prs=$(gh api repos/$GITHUB_REPOSITORY/pulls -q '.[] | {number: .number, title: .title}') - - # 处理每个上游PR - echo "$upstream_prs" | jq -c '.' | while read -r pr; do - pr_number=$(echo $pr | jq -r '.number') - pr_title=$(echo $pr | jq -r '.title') - pr_head=$(echo $pr | jq -r '.head') - pr_base=$(echo $pr | jq -r '.base') - - # 检查本地是否已经有这个PR - if ! echo "$local_prs" | jq -e --arg title "[Upstream PR #$pr_number] $pr_title" '.title == $title' > /dev/null; then - echo "同步上游PR #$pr_number: $pr_title" - - # 获取PR的详细信息 - pr_details=$(gh api repos/$UPSTREAM_REPO/pulls/$pr_number) - pr_body=$(echo "$pr_details" | jq -r '.body') - pr_branch="upstream-pr-$pr_number" - - # 创建本地分支 - git fetch --all - git checkout -b $pr_branch - - # 从上游仓库拉取PR - git fetch https://github.com/$UPSTREAM_REPO.git pull/$pr_number/head:$pr_branch - git checkout $pr_branch - - # 推送到本地仓库 - git push origin $pr_branch -f - - # 使用单行描述创建PR - gh pr create \ - --title "[Upstream PR #$pr_number] $pr_title" \ - --body "Auto-synced from https://github.com/$UPSTREAM_REPO/pull/$pr_number" \ - --base $pr_base \ - --head $pr_branch - - git checkout main - done \ No newline at end of file