| modules | Initial commit | |
| src | Mirror GitHub workflow annotations ( closes #26 ) | |
| .gitignore | stats reporting | |
| git.sh | Add co-authors-trailers to co-authors log | |
| icon.png | Basic issue and comment creation | |
| LICENSE | Added license | |
| Makefile | Specify UTF8 encoding in makefile | |
| muninconf | update stats | |
| README.md | Handle CI-less repos cleanly | |
| run.sh | Add run convenience file | |
GitHub / Codeberg Mirror
This provides a bot to periodically sync our development environments at Codeberg and GitHub. The purpose of the system is to allow contributors to use GitHub and Codeberg interchangeably, or only either one of the two, at each contributor's choice.
The bot mirrors PRs, Issues, Branches, Milestones, Labels, Releases, and CI workflow results. It does not mirror Reactions, Commit comments, Discussions, Projects, and repository settings.
The bot also provides a merge bot to merge PRs automatically as soon as all requirements are met. It is strongly discouraged to merge PRs directly instead of using the merge bot.
The bot is assumed to always run as the same bot user who uses the same account name on both services.
Before use, create a config.json file to list the bot's Personal Access Tokens for both services, and the mappings for the repositories. Example:
{
"botname": "bot-user-name", /* The bot user's username. */
"mirrored-since": "2023年01月01日T00:00:00Z", /* Treat bot activity before this timestamp as regular activity. */
"dryrun": false, /* If you're just testing and don't actually want to commit any changes. */
"max-detailed-ci-results": 2, /* Maximum number of detailed logs for failing CI checks. */
"Codeberg-PAT": "abcdef123456", /* The bot's personal access token for Codeberg. */
"GitHub-PAT": "987654fedcba", /* The bot's personal access token for GitHub. */
"email": ["hello.world@example.com"], /* List of addresses who receive notifications about fatal errors. */
"mirrors": [ /* List of repos to mirror. */
{
"Codeberg-Org": "my-org", /* Name of the organization that owns the Codeberg repo. */
"Codeberg-Repo": "my-repo", /* Name of the repo on Codeberg. */
"GitHub-Org": "other-org", /* Name of the organization that owns the GitHub repo. */
"GitHub-Repo": "other-repo", /* Name of the repo on GitHub. */
"issues": true, /* Whether to mirror issues. */
"huge": false, /* Repos with >30000 comments need special handling. */
"ci": true, /* Whether to expect CI checksuite results. */
"format": "./fix_formatting.sh", /* Command to reformat branches; may be null. */
"path": "/home/foo/repo-checkout", /* Path to the git checkout of this repo. */
"branches": ["master"] /* List of branches to sync always. */
}
]
}
Compile and start the bot directly using
make run
or as a daemon process using
./run.sh
This requires a Java Development Kit. Optionally curl is required.
sudo apt-get install openjdk-17-jdk curl