跳到正文
Skillpedia
部署与云(DevOps)48k · #4745

github-actions-templates

它能做什么

这个工具可以帮你创建可直接用于生产环境的模板,用来在 GitHub 上自动化测试、构建和部署你的软件项目。它还提供了如何设置这些自动化流程的示例。

适用场景

  • ✓你想自动化运行代码测试的时候。
  • ✓准备构建或发布项目的时候。
  • ✓想设置一个经过授权的部署工作流时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/github-actions-templates/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/github-actions-templates/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“为我的 Node.js 项目创建一个测试用的工作流模板。”

每周 5 个新技能,1 分钟读完。

工作原理

这个工具提供了可以改造使用的代码示例(即“工作流”)。这些示例展示了 GitHub 如何自动运行特定的命令(比如测试)来处理你的项目。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

GitHub Actions Workflow Patterns

When to Use

Implement testing, matrix builds, artifact preparation or an explicitly authorized deployment workflow for an existing repository.

Inputs

Inspect the repository's actual scripts, lockfile, supported runtimes, required check names and release policy. Read resources/implementation-playbook.md and references/common-workflows.md before choosing job boundaries.

Test Workflow

This Node example assumes the target repository declares npm test and supports Node 22. Adapt the runtime and command to the actual project. The pinned action revisions are explicit review inputs; verify them before adopting or updating the template.

name: Test
on:
  pull_request:
  push:
    branches: [main]
permissions:
  contents: read
jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
        with:
          persist-credentials: false
      - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444
        with:
          node-version: '22'
          cache: npm
      - run: npm ci
      - run: npm test

Matrix Builds

Add a matrix only for versions and operating systems the project supports. Keep dependencies reproducible, identify failing combinations, and avoid hiding failures with blanket continue-on-error. Test required-check behavior when jobs are conditionally skipped.

Build and Publication

Build an artifact from the tested commit and record its identity. Publication needs a separate trusted job with the minimum registry permission. Do not publish artifacts produced by arbitrary untrusted code in a privileged context; bind accepted artifacts to their exact source and producing workflow.

Deployment

Use the project's protected release path. Identify the immutable artifact, destination, workload identity, rollout and rollback checks before adding deployment commands. A named GitHub environment does not configure reviewers automatically. Verify its actual protections. Do not label a placeholder echo command as a successful deployment.

Verification

Exercise one passing change and one deliberate test failure on a topic branch. Confirm the failing check prevents downstream publication. Inspect tokens, runner isolation, caches and artifact boundaries. Keep production credentials absent from untrusted validation jobs.

Example

A project needs Linux and Windows tests. Select its supported runtime, add the two runner combinations and confirm that either failure blocks the required result. Prepare publication separately; do not add registry credentials to the matrix.

Limitations

This skill supplies patterns, not an installed deployment program. Repository policy, runner trust and environment settings must be inspected. Review every third-party action at its full commit SHA and treat logs and uploaded artifacts as possible data-exposure paths.

Sources

常见问题

什么是 GitHub Actions 的“工作流”(workflow)?

它是一个配置文件,告诉 GitHub 在某些事件发生时(比如推送新的修改)该做什么,例如运行测试或发布代码。

这个模板能用于任何项目吗?

这些模板适用于托管在 GitHub 上的项目。你需要根据自己的项目类型和所用工具进行调整。

它会自动发布我的代码吗?

这个工具提供了发布相关的模板,但你需要仔细设置并授权这一操作,确保只发布可信的构建产物(artifact)。

详情

作者的原始描述

Production-ready GitHub Actions workflow patterns for testing, building, and deploying applications.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4745
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能