This is the GitHub Action for github-mirror-gitea.
A GitHub Action to mirror all of your GitHub repositories to your Gitea server, with multiple options.
Repositories created are mirrors of the original repositories, and by default Gitea will automatically fetch them every 8 hours.
Make sure you have added the following configuration in your Gitea server's gitea/conf/app.ini
file:
[migrations]
ALLOWED_DOMAINS = github.com, *.github.com
Example workflow file:
name: Mirror GitHub to Gitea
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: GitHub mirror Gitea
uses: katorlys/gitea-mirror-action@v1
with:
GITHUB_USERNAME: ${{ secrets.GH_USERNAME }}
GITHUB_PAT: ${{ secrets.GH_PAT }}
GITEA_HOST: ${{ secrets.GITEA_HOST }}
GITEA_USERNAME: ${{ secrets.GITEA_USERNAME }}
GITEA_PAT: ${{ secrets.GITEA_PAT }}
CREATE_ORG: true
REMOVE_INEXIST_REPO: false
REMOVE_EXISTING_REPO: false
MIRROR_OWNED: true
MIRROR_PRIVATE: true
MIRROR_FORKED: true
MIRROR_STARRED: false
MIRROR_COLLABORATOR: false
MIRROR_ORGANIZATION: false
MODE: 'blacklist'
REGEX: 'EpicGames/.*,NVIDIAGameWorks/.*'
All credentials are needed to be configured properly:
Key | Description |
---|---|
GITHUB | |
USERNAME | Your GitHub username |
PAT | Your GitHub personal access token, needed permissions: - repo (Full control of private repositories) If you only want to mirror public repositories, grant the following only: - repo:public_repo |
GITEA | |
USERNAME | Your Gitea username |
HOST | Your Gitea hostname, starts with http:// or https:// |
PAT | Your Gitea personal access token, needed permissions: - repository: Read and Write If you set CREATE_ORG in options.toml to true, you also need to grant:- organization: Read and Write |
You can customize these options for mirroring:
Key | Description |
---|---|
CONFIG | |
CREATE_ORG | Create a new organization in Gitea when the repository username is different from your GitHub username. |
REMOVE_INEXIST_REPO | Remove all repositories in Gitea owned by the user (including those in organizations) that do not exist in GitHub. |
REMOVE_EXISTING_REPO | Remove existing repositories in Gitea. This will only remove the repositories that have the same name as the repositories in GitHub. You may not want to enable this option, since Gitea will automatically fetch the mirror repositories every 8 hours. |
MIRROR_OWNED | Mirror the repositories you own. |
MIRROR_PRIVATE | Mirror private repositories you own. |
MIRROR_FORKED | Mirror the repositories you forked. |
MIRROR_STARRED | Mirror the repositories you starred. |
MIRROR_COLLABORATOR | Mirror the repositories that you have collaborator access. See: https://docs.github.com/zh/rest/repos/repos#list-repositories-for-the-authenticated-user |
MIRROR_ORGANIZATION | Mirror the repositories in organizations that you are a member. |
RULE | |
MODE | whitelist or blacklist to only mirror or skip repositories that match the regex. |
REGEX | Regex list. |
Copyright © 2024-present Katorly Lab