360 Secure SkillHub
360 安全技能中心

GitHub Workflow

核心功能:借助gh CLI执行GitHub全流程操作,含认证、PR管理、CI/CD运维、版本发布、密钥设置、分支保护等,还规范了分支模型与提交约定。典型场景:PR创建合并、CI故障排查、版本发布、新仓库配置等。需指定仓库,遵循安全规范,输入操作指令输出对应结果。

kretkas
kretkas
热度 16.03
最近更新 2026-05-07 07:27:04
分类:开发依赖:代码执行应用场景:代码审查 / 调试排错 / API 集成 / DevOps ...

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add github-workflow-main
Metadata
name
github
description
Professional GitHub workflows via gh CLI. Use for repos, branches, PRs, CI/CD, releases, versioning, secrets, issues. Trigger on: GitHub, git, repo, PR, branch, merge, release, CI, Actions, issue, tag, version.

GitHub Skill

gh CLI for all operations. Always --repo owner/repo outside a git directory.

Security (always)

  • Auth: gh auth login --web or GITHUB_TOKEN env var
  • Secrets: gh secret set NAME --repo owner/repo (interactive, never --body)
  • Never print/log tokens. gh auth status to verify.

Quick Reference

Task Command
Auth check gh auth status
List PRs gh pr list --repo o/r
Create PR gh pr create --repo o/r --title "..." --base develop --head branch
PR checks gh pr checks <n> --repo o/r
Merge (squash) gh pr merge <n> --squash --delete-branch --repo o/r
Failed CI logs gh run view <id> --log-failed --repo o/r
Re-run failed gh run rerun <id> --failed-only --repo o/r
Create issue gh issue create --repo o/r --title "..." --body "..."
Create release gh release create vX.Y.Z --repo o/r --title "..." --notes "..."
Set secret gh secret set KEY --repo o/r
Branch protect gh api --method PUT repos/o/r/branches/main/protection ...

Branching Model

main       ← production, protected
develop    ← integration
feature/*  ← from develop
fix/*      ← from develop (reference issue: fix/123-desc)
hotfix/*   ← from main (emergency)
release/*  ← from develop (prep)

Commit convention: feat: description (#42) / fix: description (#42) PR merge: --squash for features, --merge for releases. Semver: MAJOR.MINOR.PATCH — breaking/feature/fix.

When to read reference files

Load only what you need for the current task:

Task Read
Setting up a new repo, branch protection references/repo-setup.md
PRs, reviews, merge strategies references/pull-requests.md
CI runs, GitHub Actions references/ci-actions.md
Releases, versioning, tags references/releases.md
Secrets, environments references/secrets-envs.md
JSON queries, audit, search references/api-queries.md