360 Secure SkillHub
360 安全技能中心

GitHub Workflow

提供基于 gh CLI 的 GitHub 工作流指引,覆盖认证、分支模型与提交约定、PR 创建与合并、CI 日志查看与重跑、Issue、Release 与 SemVer 版本、Secrets 与环境、分支保护及 API 查询,并附六份按任务加载的参考文件。

kretkas
kretkas
热度 30.34
最近更新 2026-05-07 19:13:16
分类:开发依赖:代码执行 / 第三方 API应用场景:DevOps / 代码审查 / 工作流 / API 集成

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add github-wf
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