-
Notifications
You must be signed in to change notification settings - Fork 10
46 lines (41 loc) · 1.55 KB
/
github-org-to-gitee-org.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 Org to Gitee Org
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 huayin-opensource -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 Org to Gitee Org
uses: k8scat/[email protected]
with:
source_protocol: https
source_host: github.com
source_username: huayin-opensource
source_token: ${{ secrets.GITHUB_TOKEN }}
dest_protocol: https
dest_host: gitee.com
dest_username: huayin-opensource
dest_token: ${{ secrets.DEST_TOKEN_GITEE }}
dest_token_username: k8scat
mirror_repos: ${{ steps.list_repos.outputs.repo_list }}
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/orgs/${INPUT_DEST_USERNAME}/repos"
lark_webhook: ${{ secrets.LARK_WEBHOOK }}
notify_prefix: "GitHub Org to Gitee Org"
ignore_error: "true"