fix: 修复版本tag异常的工作流
This commit is contained in:
parent
8fc77f90af
commit
69f8a82582
|
@ -1,12 +1,17 @@
|
||||||
name: Sync Github To Image
|
name: Sync Github To Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Publish Release"] # 监听的工作流名称
|
||||||
|
types:
|
||||||
|
- completed # 监听完成事件
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
#schedule:
|
#schedule:
|
||||||
# 定时任务,每天 UTC 时间 0 点运行
|
# 定时任务,每天 UTC 时间 0 点运行
|
||||||
#- cron: "0 0 * * *"
|
#- cron: "0 0 * * *"
|
||||||
#workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sync-gitlink:
|
sync-gitlink:
|
||||||
|
@ -42,21 +47,22 @@ jobs:
|
||||||
|
|
||||||
# 添加远端
|
# 添加远端
|
||||||
- name: add remote url
|
- name: add remote url
|
||||||
run: git remote add gitlink "git@code.gitlink.org.cn:${{ github.Repository }}.git"
|
run: git remote add mirror "git@code.gitlink.org.cn:${{ github.Repository }}.git"
|
||||||
|
|
||||||
# 获取
|
# 获取
|
||||||
- name: fetch
|
- name: fetch
|
||||||
run: git fetch --prune gitlink --tags --verbose
|
run: git fetch --prune mirror --tags --verbose
|
||||||
|
|
||||||
# 拉取
|
# 拉取和推送
|
||||||
- name: pull and push
|
- name: pull and push
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.ref_name }}" ]; then
|
if [ "${{ github.ref_name }}" ]; then
|
||||||
git checkout ${{ github.ref_name }}
|
git checkout ${{ github.ref_name }}
|
||||||
git pull --progress -v --no-rebase gitlink ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支;
|
git push -f mirror ${{ github.ref_name }}
|
||||||
git push -u gitlink ${{ github.ref_name }} --tags --verbose
|
git push -f mirror --tags --verbose
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
sync-gitlab:
|
sync-gitlab:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
@ -88,21 +94,22 @@ jobs:
|
||||||
|
|
||||||
# 添加远端
|
# 添加远端
|
||||||
- name: add remote url
|
- name: add remote url
|
||||||
run: git remote add gitlab "git@gitlab.com:${{ github.Repository }}.git"
|
run: git remote add mirror "git@gitlab.com:${{ github.Repository }}.git"
|
||||||
|
|
||||||
# 获取
|
# 获取
|
||||||
- name: fetch
|
- name: fetch
|
||||||
run: git fetch --prune gitlab --tags --verbose
|
run: git fetch --prune mirror --tags --verbose
|
||||||
|
|
||||||
# 拉取
|
# 拉取和推送
|
||||||
- name: pull and push
|
- name: pull and push
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.ref_name }}" ]; then
|
if [ "${{ github.ref_name }}" ]; then
|
||||||
git checkout ${{ github.ref_name }}
|
git checkout ${{ github.ref_name }}
|
||||||
git pull --progress -v --no-rebase gitlab ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支;
|
git push -f mirror ${{ github.ref_name }}
|
||||||
git push -u gitlab ${{ github.ref_name }} --tags --verbose
|
git push -f mirror --tags --verbose
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
sync-gitee:
|
sync-gitee:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
@ -134,21 +141,22 @@ jobs:
|
||||||
|
|
||||||
# 添加远端
|
# 添加远端
|
||||||
- name: add remote url
|
- name: add remote url
|
||||||
run: git remote add gitee "git@gitee.com:${{ github.Repository }}.git"
|
run: git remote add mirror "git@gitee.com:${{ github.Repository }}.git"
|
||||||
|
|
||||||
# 获取
|
# 获取
|
||||||
- name: fetch
|
- name: fetch
|
||||||
run: git fetch --prune gitee --tags --verbose
|
run: git fetch --prune mirror --tags --verbose
|
||||||
|
|
||||||
# 拉取
|
# 拉取和推送
|
||||||
- name: pull and push
|
- name: pull and push
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.ref_name }}" ]; then
|
if [ "${{ github.ref_name }}" ]; then
|
||||||
git checkout ${{ github.ref_name }}
|
git checkout ${{ github.ref_name }}
|
||||||
git pull --progress -v --no-rebase gitee ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支;
|
git push -f mirror ${{ github.ref_name }}
|
||||||
git push -u gitee ${{ github.ref_name }} --tags --verbose
|
git push -f mirror --tags --verbose
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
sync-atomgit:
|
sync-atomgit:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
@ -180,21 +188,22 @@ jobs:
|
||||||
|
|
||||||
# 添加远端
|
# 添加远端
|
||||||
- name: add remote url
|
- name: add remote url
|
||||||
run: git remote add atomgit "git@atomgit.com:${{ github.Repository }}.git"
|
run: git remote add mirror "git@atomgit.com:${{ github.Repository }}.git"
|
||||||
|
|
||||||
# 获取
|
# 获取
|
||||||
- name: fetch
|
- name: fetch
|
||||||
run: git fetch --prune atomgit --tags --verbose
|
run: git fetch --prune mirror --tags --verbose
|
||||||
|
|
||||||
# 拉取
|
# 拉取和推送
|
||||||
- name: pull and push
|
- name: pull and push
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.ref_name }}" ]; then
|
if [ "${{ github.ref_name }}" ]; then
|
||||||
git checkout ${{ github.ref_name }}
|
git checkout ${{ github.ref_name }}
|
||||||
git pull --progress -v --no-rebase atomgit ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支;
|
git push -f mirror ${{ github.ref_name }}
|
||||||
git push -u atomgit ${{ github.ref_name }} --tags --verbose
|
git push -f mirror --tags --verbose
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
sync-gitcode:
|
sync-gitcode:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
@ -226,20 +235,21 @@ jobs:
|
||||||
|
|
||||||
# 添加远端
|
# 添加远端
|
||||||
- name: add remote url
|
- name: add remote url
|
||||||
run: git remote add gitcode "git@gitcode.net:${{ github.Repository }}.git"
|
run: git remote add mirror "git@gitcode.net:${{ github.Repository }}.git"
|
||||||
|
|
||||||
# 获取
|
# 获取
|
||||||
- name: fetch
|
- name: fetch
|
||||||
run: git fetch --prune gitcode --tags --verbose
|
run: git fetch --prune mirror --tags --verbose
|
||||||
|
|
||||||
# 拉取
|
# 拉取和推送
|
||||||
- name: pull and push
|
- name: pull and push
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.ref_name }}" ]; then
|
if [ "${{ github.ref_name }}" ]; then
|
||||||
git checkout ${{ github.ref_name }}
|
git checkout ${{ github.ref_name }}
|
||||||
git pull --progress -v --no-rebase gitcode ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支;
|
git push -f mirror ${{ github.ref_name }}
|
||||||
git push -u gitcode ${{ github.ref_name }} --tags --verbose
|
git push -f mirror --tags --verbose
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
sync-framagit:
|
sync-framagit:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -272,17 +282,17 @@ jobs:
|
||||||
|
|
||||||
# 添加远端
|
# 添加远端
|
||||||
- name: add remote url
|
- name: add remote url
|
||||||
run: git remote add framagit "git@framagit.org:${{ github.Repository }}.git"
|
run: git remote add mirror "git@framagit.org:${{ github.Repository }}.git"
|
||||||
|
|
||||||
# 获取
|
# 获取
|
||||||
- name: fetch
|
- name: fetch
|
||||||
run: git fetch --prune framagit --tags --verbose
|
run: git fetch --prune mirror --tags --verbose
|
||||||
|
|
||||||
# 拉取
|
# 拉取和推送
|
||||||
- name: pull and push
|
- name: pull and push
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.ref_name }}" ]; then
|
if [ "${{ github.ref_name }}" ]; then
|
||||||
git checkout ${{ github.ref_name }}
|
git checkout ${{ github.ref_name }}
|
||||||
git pull --progress -v --no-rebase framagit ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支;
|
git push -f mirror ${{ github.ref_name }}
|
||||||
git push -u framagit ${{ github.ref_name }} --tags --verbose
|
git push -f mirror --tags --verbose
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue