No. 040 部署上线

编写 GitHub Actions 工作流,在每次推送到 {branch} 时{steps}

当更改需要离开本机时使用

  • Claude Code
  • Codex
  • Cursor
  • 部署上线

提示词

译

编写一个 GitHub Actions 工作流,在每次推送到 {branch} 时{steps}

什么时候用

当更改需要离开本机时,「编写 GitHub Actions 工作流,在每次推送到 {branch} 时{steps}」 就是要打开的提示词,因为它写着“编写一个 GitHub Actions 工作流,在每次推送到 {branch} 时{steps}”,在把 {steps}、{branch} 替换为仓库中的名称后使用。

为 「编写 GitHub Actions 工作流,在每次推送到 {branch} 时{steps}」 填写好的一条消息是:编写一个 GitHub Actions 工作流,在每次推送到 cart-total 分支时安装、测试和构建

什么时候别用

当更改仍只是本地问题、没有任何内容准备交付时,不要使用 「编写 GitHub Actions 工作流,在每次推送到 {branch} 时{steps}」,因为“编写一个 GitHub Actions 工作流,在每次推送到 {branch} 时{steps}”指向相反的情况。

怎么用

Claude Code

Claude Code 把 「编写 GitHub Actions 工作流,在每次推送到 {branch} 时{steps}」 当作在仓库根目录的一次粘贴输入。不要另外保存 .claude/commands,否则“编写一个 GitHub Actions 工作流,在每次推送到 {branch} 时{steps}”会在下一个任务中重放。

Codex

Codex 把 「编写 GitHub Actions 工作流,在每次推送到 {branch} 时{steps}」 当作任务上方的一次粘贴输入。保持 AGENTS.md 不变,以免下一个线程继承“编写一个 GitHub Actions 工作流,在每次推送到 {branch} 时{steps}”。

Cursor

Cursor 只应在本轮把 「编写 GitHub Actions 工作流,在每次推送到 {branch} 时{steps}」 视为“编写一个 GitHub Actions 工作流,在每次推送到 {branch} 时{steps}”的聊天粘贴输入。位于 .cursor/rules 的文件会在本轮结束后继续生效。

使用前后对比

对比待补

这条前后对比还没有在本机跑过。

相关

来源:Anthropic · https://code.claude.com/docs/en/prompt-library · 2026-12-01