From 630ac2c89cca27ab2eb2e0a2a9f5ff0a48d4a031 Mon Sep 17 00:00:00 2001 From: NianBroken Date: Thu, 15 Feb 2024 13:20:58 +0800 Subject: [PATCH] Update --- .github/workflows/main.yml | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c86d004..9c0220c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,12 +21,26 @@ on: - "False" jobs: + #公共步骤 + CommonSteps: + name: CommonSteps + + # 在最新版的Ubuntu系统上运行 + runs-on: ubuntu-latest + + steps: + - name: Configure Git + run: | + # 配置Git用户信息 + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + # 同步上游分支 SyncFork: name: SyncFork - # 在最新版的Ubuntu系统上运行 - runs-on: ubuntu-latest + # CommonSteps执行完成后运行 + needs: CommonSteps # 定义SyncFork的变量 outputs: @@ -37,12 +51,6 @@ jobs: - name: Checkout Repository uses: actions/checkout@main - - name: Configure Git - run: | - # 配置Git用户信息 - git config --global user.email "actions@github.com" - git config --global user.name "GitHub Actions" - - name: Fetch upstream changes run: | # 添加上游仓库作为远程仓库,并获取上游仓库的main分支的最新更改 @@ -118,9 +126,6 @@ jobs: # SyncFork执行完成后运行 needs: SyncFork - # 在最新版的Ubuntu系统上运行 - runs-on: ubuntu-latest - steps: # 使用GitHub Actions提供的动作来检出代码库 - name: Checkout Repository @@ -130,7 +135,7 @@ jobs: - name: Set up Python uses: actions/setup-python@main with: - python-version: '*' + python-version: "*" - name: Install dependencies run: |