| name | github-operations |
| description | GitHub platform best practices, workflow patterns, API usage, and automated flows for PR creation, releases, and repository management. Auto-loaded when working with .github/ files. |
GitHub Operations Skill
When This Skill Activates
When working with .github/** files, GitHub Actions workflows, or any GitHub platform integration.
GitHub Actions Workflow Checklist
Before creating or modifying a workflow, verify:
Repository Security Checklist
Release Flow (Automated)
When user says "do a release" or "publish new version":
- Pre-check: Verify on
main, CI green, no uncommitted changes
- Version: Bump version in
package.json (follow semver)
- Changelog:
git log --oneline $(git describe --tags --abbrev=0)..HEAD
- Tag:
git tag v{version}
- Push:
git push origin main --tags
- Verify: GitHub Actions publishes to npm, creates GitHub Release
- Confirm:
gh release view v{version} + npm view {package} version
PR Creation Flow (Automated)
When finishing a feature or when user says "create a PR":
- Pre-check: Verify on feature branch (not
main), changes committed
- Push:
git push -u origin {branch}
- Create:
gh pr create --title "type: description" --body "## Summary\n- changes"
- Labels: Add relevant labels (
--label enhancement)
- Link: Reference issue if applicable (
Closes #123)
- Monitor:
gh pr checks {number} to verify CI passes
GitHub CLI (gh) Quick Reference
PRs
gh pr create --title "feat: X" --body "summary"
gh pr list --state open
gh pr merge 123 --squash --delete-branch
gh pr checks 123
Issues
gh issue create --title "Bug: X" --label bug
gh issue list --label enhancement --state open
gh issue close 123 --reason completed
Releases
gh release create v1.0.0 --generate-notes
gh release list
Actions
gh run list --limit 5
gh run view 12345 --log-failed
gh workflow run ci.yml
API (Raw)
gh api repos/{owner}/{repo}/pulls --jq '.[].title'
gh api graphql -f query='{ repository(owner:"X", name:"Y") { issues(first:10) { nodes { title } } } }'
GitHub API Patterns
Rate Limit Management
- Use ETags:
If-None-Match header → 304 responses don't count against limits
- Paginate with
per_page=100 and Link header
- GitHub App: 5000 req/hr per installation
- GITHUB_TOKEN in Actions: 1000 req/hr
Projects v2 (GraphQL)
mutation {
addProjectV2ItemById(input: {
projectId: "PVT_xxx"
contentId: "I_xxx"
}) { item { id } }
}
Common Pitfalls
- Missing
id-token: write permission for npm provenance
- Using
npm install instead of npm ci (non-reproducible builds)
- No
timeout-minutes → stuck jobs run for 6 hours
@latest action tags → breaking changes in CI
- Secrets logged via
echo or error messages
- Missing
concurrency → 5 duplicate runs on rapid pushes