Mainer
Uses GitHub API to help repos switch from "master" to "main"
Install / Use
/learn @sgillies/MainerREADME
mainer
Mainer helps GitHub repo users switch "master" branches to "main".
Branch renaming is the easy part. But you may be left with hundreds or thousands of links to "master" in GitHub issue and PR comments. This is where mainer comes in.
Mainer uses the GitHub API to find issues, PRs, and comments which have text linking to the master branch of a repo (the same or another) and rewrites that text to link to the main branch instead.
Note well: this is pre-release software. Do use mainer's --dry-run mode first
to see what would happen in a real, text-altering use of the program.
Installation
python -m pip install --pre mainer
Usage
$ python -m mainer --help
Usage: mainer.py [OPTIONS] ORG/REPO
Rewrite links in a repo's issue and PR comments so that they point to the
linked repo's main branch instead of its master branch.
Example:
python -m mainer org1/repo1 --rewrite-links-to org2/repo2 --dry-run
Options:
--dry-run Print comment diffs to stderr, but make no edits.
--rewrite-links-to TEXT The repo named in the links to be fixed. For
example: 'org2/repo2'. Defaults to ORG/REPO.
--access-token TEXT A GitHub access token. May also be set by
GITHUB_ACCESS_TOKEN or GithubAccessToken in the
environment.
--help Show this message and exit.
Dry run mode
With the --dry-run option, mainer prints diffs representing the changes it would make to comments of the target repo.
Editing mode
Attention: without the --dry-run option, mainer will edit comments without confirmation prompts or backups (like, for example sed -i).
Related Skills
node-connect
351.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
