-
Notifications
You must be signed in to change notification settings - Fork 10
46 lines (41 loc) · 1.47 KB
/
github-to-gitee.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: GitHub to Gitee
on:
workflow_dispatch:
# schedule:
# - cron: "0 2 * * 3"
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login Source GitHub
run: |
gh --version
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
gh auth status
- name: List repos
id: list_repos
run: |
repo_list=$(gh repo list -L 1000 --json name -t '{{range $i, $n := .}}{{if (gt $i 0)}},{{end}}{{$n.name}}{{end}}')
echo "::set-output name=repo_list::${repo_list}"
- name: GitHub to Gitee
uses: k8scat/[email protected]
with:
source_protocol: https
source_host: github.com
source_username: k8scat
source_token: ${{ secrets.GITHUB_TOKEN }}
dest_protocol: https
dest_host: gitee.com
dest_username: k8scat
dest_token: ${{ secrets.DEST_TOKEN_GITEE }}
mirror_repos: ${{ steps.list_repos.outputs.repo_list }}
ignored_repos: ",Gigrator,"
dest_create_repo_script: |
curl \
-H 'Content-Type: application/json;charset=UTF-8' \
-d "{\"access_token\":\"${INPUT_DEST_TOKEN}\",\"name\":\"${REPO_NAME}\",\"private\":\"true\"}" \
'https://gitee.com/api/v5/user/repos'
lark_webhook: ${{ secrets.LARK_WEBHOOK }}
notify_prefix: "GitHub to Gitee"
ignore_error: "true"