Skip to content

Commit 3afe046

Browse files
authored
Create sync-to-gitee.yml
1 parent 7d886a5 commit 3afe046

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Sync to Gitee
2+
3+
# 显式声明最小化权限
4+
permissions:
5+
contents: write # 必须的写入权限(用于push)
6+
actions: read # 可选监控权限
7+
8+
on:
9+
schedule:
10+
- cron: '0 0 * * *'
11+
push:
12+
branches: [ master ]
13+
pull_request:
14+
types: [ closed ]
15+
branches: [ master ]
16+
workflow_dispatch:
17+
18+
env:
19+
GITEE_REPO: "https://${{ secrets.GITEE_USERNAME }}:${{ secrets.GITEE_TOKEN }}@gitee.com/osard/DialogUtilsLib.git"
20+
21+
jobs:
22+
sync-to-gitee:
23+
runs-on: ubuntu-latest
24+
25+
permissions:
26+
contents: write # 仅保留必要的写入权限
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Mirror to Gitee
35+
run: |
36+
git remote add gitee ${{ env.GITEE_REPO }}
37+
git push --mirror --force gitee

0 commit comments

Comments
 (0)