Loading...
Loading...
General GitHub basic operations + GitHub platform objects (Issues/Labels/Milestones/Releases/Actions) automation skill (Minis environment). This skill must be triggered when users mention any Git/GitHub basic operations and workflows such as "how to use GitHub, clone, init, remote, branch, commit, push, pull, fetch, merge, rebase, tag, release, issues, actions, labels, milestone, protected branch, fork, PR, sync to upstream, delete branch, restore after emptying directory, push directly to main, one-click sync".
npx skill4agent add openminis/minisskills github-sync-helper| No. | Rule | Reason |
|---|---|---|
| 1 | Do not output Token: No command shall echo/print | Prevent leakage |
| 2 | Secondary confirmation for dangerous operations: Delete branch, empty directory, force overwrite, force push, push directly to main | Poor reversibility |
| 3 | Use "branch + PR" collaboration by default; only push directly to main when explicitly requested by the user | Reduce damage to the main branch |
| 4 | Run | Prevent accidental commits/overwrites |
sh /var/minis/skills/github-sync-helper/scripts/gh_sync.sh <command> [options]The script runs in the "current git repository directory" (must be inside the repository).
| No. | Category | Operation | One-sentence Explanation | Common Commands | Script Support |
|---|---|---|---|---|---|
| 1 | Initialization | init | Turn the current directory into a git repository | | |
| 2 | Get Code | clone | Download repository from remote to local | | |
| 3 | Remote | remote | Manage remotes like origin/upstream | | |
| 4 | Branch | branch | View/create/delete branches | | |
| 5 | Switch | checkout/switch | Switch to a certain branch | | |
| 6 | View Changes | status/diff/log | View workspace changes/differences/history | | |
| 7 | Stage | add | Add changes to the staging area | | |
| 8 | Commit | commit | Package the staging area into a commit | | |
| 9 | Sync | fetch/pull/push | Pull/merge/push commits | | |
| 10 | Merge | merge/rebase | Merge branch history | | |
| 11 | Stash | stash | Temporarily store uncommitted changes | | |
| 12 | Tag | tag | Add version number to a commit | | |
| 13 | Submodule | submodule | Manage sub-repository dependencies | | |
| 15 | GitHub Platform | issues/labels/milestones/releases/actions | Manage platform objects via GitHub API | (API) | |
Note: The script is positioned to "turn common basic operations into reusable commands". For complex rebase/conflicts, it is still recommended to use interactive terminal processing.
Unified requirement: Requires env.GITHUB_TOKEN
| No. | Command | Function |
|---|---|---|
| 1 | `gh-issues-list --repo <owner/repo> [--state open | closed |
| 2 | | Create Issue |
| 3 | | Close Issue |
| 4 | | List labels |
| 5 | | Create label |
| 6 | `gh-milestones-list --repo <owner/repo> [--state open | closed |
| 7 | | Create milestone |
| 8 | | List releases |
| 9 | `gh-release-create --repo <owner/repo> --tag <vX.Y.Z> --name <n> [--body <b>] [--draft true | false] [--prerelease true |
| 10 | | List workflows |
| 11 | | Manually trigger workflow_dispatch |
| No. | Command | Function |
|---|---|---|
| 2 | | Clone repository to the specified directory |
| 3 | | Display current remotes |
| 4 | | Add remote |
| 5 | | Modify remote URL |
| 6 | | Delete remote |
| 7 | | Add upstream remote |
| 8 | | |
| 9 | | View differences |
| 10 | | View recent commits |
| 11 | | List local and remote branches |
| 12 | | Create branch |
| 13 | | Switch branch |
| 14 | | Delete local/remote branches except the kept one |
| 15 | | |
| 16 | | |
| 17 | | Pull remote updates |
| 18 | | Pull and merge |
| 19 | | Push |
| 20 | | Push current main to origin (non-interactive using token) |
| 21 | | Empty a directory in the repository but keep the directory (using .gitkeep) |
| 22 | | Overwrite and restore to the repository directory using local directory (will delete dst content first) |
| 23 | | Create PR via GitHub API |
| 24 | | GitHub platform object operations (issues/labels/milestones/releases/actions) |
sh /var/minis/skills/github-sync-helper/scripts/gh_sync.sh empty-dir --dir self-improving-agent
sh /var/minis/skills/github-sync-helper/scripts/gh_sync.sh restore-dir --src /var/minis/skills/self-improving-agent --dst self-improving-agent
sh /var/minis/skills/github-sync-helper/scripts/gh_sync.sh commit --message "restore(self-improving-agent): sync from local"
sh /var/minis/skills/github-sync-helper/scripts/gh_sync.sh push-main# 1. Pull/refresh the repository
repo_dir=/var/minis/workspace/<repo>
if [ -d "$repo_dir/.git" ]; then
cd "$repo_dir" && git fetch --all --prune && git reset --hard origin/main
else
gh repo clone <owner/repo> "$repo_dir"
fi
# 2. Only content overwrite: Overwrite the target file in the repository with the source file content
cp <source_file> "$repo_dir/<target_path>"
# 3. If Git identity is not configured, prioritize reusing GitHub login name and use GitHub noreply email
cd "$repo_dir"
git config user.name '<GitHub Display Name>'
git config user.email '<login>@users.noreply.github.com'
# 4. Commit and push directly to main (only execute when the user explicitly requests commit/push)
git add <target_path>
git commit -m 'replace <target_path> content'
git push origin mainworker.jsAuthor identity unknowngit config user.name '<GitHub Display Name>'git config user.email '<login>@users.noreply.github.com'git fetchgit reset --hard origin/mainsh /var/minis/skills/github-sync-helper/scripts/gh_sync.sh delete-branches --keep mainsh /var/minis/skills/github-sync-helper/scripts/gh_sync.sh pr \
--upstream OpenMinis/MinisSkills \
--head mowenyun:main \
--base main \
--title "sync: ..." \
--body "..."No.No. | Repository(owner/repo) | Visibility | Fork | Default Branch | Last Updated | URLNote: If users need more fields (description, language, stars), addto expand.--json ...
| No. | Phenomenon | Solution |
|---|---|---|
| 1 | Push reports | Requires env |
| 2 | API 401/403 | Insufficient token permissions (repo/public_repo) or expired |
| 3 | | First |