Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create GitHub2Gitea.yaml #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .gitea/workflows/GitHub2Gitea.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: GitHub2Gitea
on:
#workflow_call:
push:
branches:
- 'master'
schedule:
# Execute on schedule
- cron: '0 5 */7 * *'

env:
# The name of the user in whose profile the repositories will be created. Leave blank to use the name from github.
# GITEA_USER: XXXX-github
# Gitea server address
GITEA_URL: https://XXXXX

# Token owner name
GITHUB_USER: XXXX
# Usernames to clone (Use space as delimiter)
GITHUB_USE: "XXXX"
# Organization to clone (Use space as delimiter)
GITHUB_ORG: "XXXX XXXX"

# don't forget to create secrets. API_GT, API_GH
jobs:
GitHub2Gitea:
name: Run GitHub2Gitea
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install tools
run: |
apt update
apt install -y jq
- name: Clone organization
run: |
export ACCESS_TOKEN=${{ secrets.API_GT }}
export GITHUB_TOKEN=${{ secrets.API_GH }}
for org in `echo "$GITHUB_ORG" | sed "s/ /\n/g"`; do \
echo "Clone organization"
./github2gitea-mirror -m org -o ${org} -u $GITHUB_USER -v private; \
done
- name: Clone user
run: |
export ACCESS_TOKEN=${{ secrets.API_GT }}
export GITHUB_TOKEN=${{ secrets.API_GH }}
for user in `echo "$GITHUB_USE" | sed "s/ /\n/g"`; do \
echo "Clone user"
./github2gitea-mirror -m user -u $user; \
done