Create manual.yml

自动同步上游代码
This commit is contained in:
JC0v0 2023-09-16 12:18:04 +08:00 committed by GitHub
parent 39ae8075e4
commit 206ed49fd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

34
.github/workflows/manual.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Manual workflow with Code Sync
on:
workflow_dispatch:
inputs:
name:
description: 'Person to greet'
default: 'World'
required: true
type: string
jobs:
greet_and_sync_code:
runs-on: ubuntu-latest
steps:
- name: Send greeting
run: echo "Hello ${{ inputs.name }}"
- name: Checkout code
uses: actions/checkout@v2 # 使用 GitHub 提供的官方操作来检出代码库
- name: Sync upstream code
run: |
# 同步上游代码
git remote add upstream https://github.com/songquanpeng/one-api.git
git fetch upstream
git checkout main # 切换到主分支,可以根据实际情况更改分支名
git merge upstream/main --no-edit # 合并上游主分支的代码,不编辑提交消息
# 在这里可以执行其他与同步后的代码相关的任务
git push origin main # 将更新后的代码推送到你的仓库