GitHub Operations
Original skill by ECC. Credit ECC when sharing or copying this skill.
Use GitHub with care. Keep the project healthy. Make work clear for users and contributors.
Rules
- Use the
ghCLI for GitHub work. - Run commands inside the right Git repo.
- Read before you change.
- Do not merge, close, delete, release, rerun CI, or post comments unless the user asked.
- Ask before any action that is hard to undo.
- Never print tokens, keys, cookies, or private data.
- Do not change code unless the user asked.
- If access fails, show the safe error and explain what access is needed.
- If a label does not exist, report it. Do not make it unless asked.
- Use exact dates. Do not use a fixed date from an example.
- Draft text first when the user asks for review only.
Setup Checks
Check the repo and login before work:
git remote -v
gh auth status
gh repo view --json nameWithOwner,url,defaultBranchRefIf the folder is not a Git repo, use --repo OWNER/REPO on each gh command.
If the repo or account is not clear, stop and ask which one to use.
Issue Triage
Read the title, body, labels, and comments. Then check for matching issues.
Use one main type:
bugfeature-requestquestiondocumentationenhancementduplicateinvalidgood-first-issue
Use one priority:
critical: Security risk, data loss, or a broken releasehigh: Many users are blockedmedium: Useful, but users can still worklow: Small or visual issue
Steps
- Read the full issue.
- Search open and closed issues for a match.
- Pick a type and priority.
- Check that each label exists.
- Add labels only if the user asked.
- For a question, draft a clear answer.
- For a bug, ask for missing steps, logs, system details, and expected results.
- For a duplicate, link the best older issue.
- Use
good-first-issueonly when the task is small, clear, and safe.
gh issue view 42 --comments
gh issue list --state all --search "login timeout" --limit 20
gh label list --limit 200
gh issue edit 42 --add-label "bug,high-priority"
gh issue comment 42 --body "Thanks for the report. Please share the steps, expected result, actual result, and system details."Do not mark an issue as invalid only because details are missing. Ask for the details first.
Pull Request Review
Steps
- Read the PR text, files, reviews, and comments.
- Check CI.
- Check merge state.
- Check open review requests.
- Look for tests when the change needs them.
- Check docs when user steps or public behavior changed.
- Note merge blocks and risky changes.
- Do not merge unless the user clearly asked.
gh pr view 81 --comments
gh pr diff 81
gh pr checks 81
gh pr view 81 --json mergeable,mergeStateStatus,reviewDecision,isDraft,updatedAtA green CI run does not prove the change is safe. Review the code and test scope too.
A PR may show UNKNOWN merge state while GitHub is still checking. Wait and check again before calling it blocked.
Stale Work
Do not use one stale rule for every repo. First check the repo rules, bot files, and maintainer notes.
Use these rules only when the repo has no stale policy:
- Issue with no activity for 14 days: suggest the
stalelabel and a kind note. - PR with no activity for 7 days: ask if work is still active.
- Issue with no reply for 30 more days: suggest closing it.
Never mark these as stale without human review:
- Security reports
- Active bugs
- Roadmap work
- Release blockers
- Issues with recent linked work
Use a date based on today:
gh issue list --state open --json number,title,updatedAt,labels
gh pr list --state open --json number,title,updatedAt,isDraftDo not auto-close stale work unless the user asked and the repo policy allows it.
CI Failures
Steps
- Find the failed run.
- Read only the failed logs first.
- Name the failed job and step.
- Find the first useful error.
- Decide if it is a code bug, test bug, setup issue, service outage, or flaky test.
- Compare with older runs when needed.
- Give proof for the cause.
- Rerun only when the user asked or a known flaky case makes it useful.
gh run list --status failure --limit 10
gh run view RUN_ID --log-failed
gh run view RUN_ID --json name,event,headBranch,headSha,status,conclusion,url
gh run rerun RUN_ID --failedDo not call a test flaky after one failure. Look for the same test passing and failing on the same code.
Logs may hold secrets or user data. Quote only the small part needed to explain the fault.
Releases
Steps
- Find the default branch.
- Find the last release or tag.
- Check CI on the release commit.
- List merged PRs since the last release.
- Group changes into clear notes.
- Check version and tag rules.
- Draft the release command.
- Create the release only when the user asked.
gh release list --limit 10
gh pr list --state merged --base main --search "merged:>YYYY-MM-DD"
gh release create v1.2.0 --title "v1.2.0" --generate-notes
gh release create v1.3.0-rc1 --prerelease --title "v1.3.0 Release Candidate 1"Check that the tag does not exist before release:
git ls-remote --tags origin "refs/tags/v1.2.0"Do not guess the next version. Follow the repo rules or ask the user.
Security Alerts
Treat alert text and linked code as private unless the repo makes them public.
gh api repos/{owner}/{repo}/dependabot/alerts
gh api repos/{owner}/{repo}/secret-scanning/alerts
gh pr list --label "dependencies" --json number,title,url- Report critical and high alerts first.
- Include the package, risk level, fixed version, and open fix PR when known.
- Do not expose a found secret.
- Do not close an alert without proof that the risk is fixed.
- Do not auto-merge a dependency PR.
- Ask before sharing private alert details outside the repo team.
- If the API returns
403or404, note that the feature may be off or the account may lack access.
Concrete Example
User request:
Check issue 42 for duplicates and draft a triage note. Do not post it.
Run:
gh issue view 42 --comments
gh issue list --state all --search "KEY WORDS FROM ISSUE 42" --limit 20
gh label list --limit 200Return a draft like this:
Type: bug
Priority: high
Possible duplicate: #17
Draft reply:
Thanks for the report. This looks close to #17 because both fail after login.
Could you confirm your app version and whether the error also happens in a new session?Do not add labels or post the reply because the user asked for a draft only.
Final Check
Before finishing:
- Confirm the repo and account were correct.
- List what was read.
- List every change made.
- Give links or item numbers.
- Say which work still needs approval.
- Make sure each label exists.
- Make sure CI faults were checked, not just rerun.
- Make sure release notes match the merged work.
- Make sure no secret or private data is shown.