Loading...
Loading...
Compare original and translation side by side
| Capability | When to Use | Reference |
|---|---|---|
| Workflows | CI/CD, automation, testing | |
| Composite Actions | Reusable step combinations | |
| Docker Actions | Custom environments/tools | |
| JavaScript Actions | API interactions, complex logic | |
| Reusable Workflows | Shared patterns across repos | |
| Security Scanning | Dependency review, SBOM | |
| Modern Features | Summaries, environments | |
| 功能 | 使用场景 | 参考文档 |
|---|---|---|
| 工作流 | CI/CD、自动化、测试 | |
| 复合操作 | 可重用步骤组合 | |
| Docker操作 | 自定义环境/工具 | |
| JavaScript操作 | API交互、复杂逻辑 | |
| 可重用工作流 | 跨仓库共享模式 | |
| 安全扫描 | 依赖审查、SBOM | |
| 现代特性 | 摘要、环境 | |
references/best-practices.mdreferences/common-actions.mdname: CI Pipeline
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm testreferences/best-practices.mdreferences/common-actions.mdname: CI Pipeline
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm testassets/templates/action/references/custom-actions.mdreferences/custom-actions.mdassets/templates/action/references/custom-actions.mdreferences/custom-actions.mdworkflow_callsecrets: inheriton:
workflow_call:
inputs:
environment:
required: true
type: string
secrets:
deploy-token:
required: true
outputs:
result:
value: ${{ jobs.build.outputs.result }}references/advanced-triggers.mdworkflow_callsecrets: inheriton:
workflow_call:
inputs:
environment:
required: true
type: string
secrets:
deploy-token:
required: true
outputs:
result:
value: ${{ jobs.build.outputs.result }}references/advanced-triggers.mdactions/dependency-review-action@v4actions/attest-sbom@v2github/codeql-actionpermissions:
contents: read
security-events: write # For CodeQL
id-token: write # For attestations
attestations: write # For attestationsreferences/best-practices.mdactions/dependency-review-action@v4actions/attest-sbom@v2github/codeql-actionpermissions:
contents: read
security-events: write # For CodeQL
id-token: write # For attestations
attestations: write # For attestationsreferences/best-practices.mdreferences/modern-features.md$GITHUB_STEP_SUMMARYreferences/modern-features.md$GITHUB_STEP_SUMMARY"[owner/repo] [version] github action documentation"mcp__context7__resolve-library-idmcp__context7__get-library-docs- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0references/common-actions.md"[owner/repo] [version] github action documentation"mcp__context7__resolve-library-idmcp__context7__get-library-docs- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0references/common-actions.mddevops-skills:github-actions-validatordevops-skills:github-actions-validator| Standard | Implementation |
|---|---|
| Security | Pin to SHA, minimal permissions, mask secrets |
| Performance | Caching, concurrency, shallow checkout |
| Naming | Descriptive names, lowercase-hyphen files |
| Error Handling | Timeouts, cleanup with |
references/best-practices.md| 标准 | 实现方式 |
|---|---|
| 安全性 | 固定到SHA、最小权限、隐藏机密 |
| 性能 | 缓存、并发、浅克隆 |
| 命名 | 描述性名称、小写连字符文件名 |
| 错误处理 | 超时、使用 |
references/best-practices.md| Document | Content | When to Use |
|---|---|---|
| Security, performance, patterns | Every workflow |
| Action versions, inputs, outputs | Public action usage |
| | Complex conditionals |
| workflow_run, dispatch, ChatOps | Workflow orchestration |
| Metadata, structure, versioning | Custom action creation |
| Summaries, environments, containers | Enhanced workflows |
| 文档 | 内容 | 使用场景 |
|---|---|---|
| 安全、性能、模式 | 所有工作流 |
| 操作版本、输入、输出 | 使用公共操作时 |
| | 复杂条件判断 |
| workflow_run、dispatch、ChatOps | 工作流编排 |
| 元数据、结构、版本控制 | 创建自定义操作时 |
| 摘要、环境、容器 | 增强型工作流 |
| Template | Location |
|---|---|
| Basic Workflow | |
| Composite Action | |
| Docker Action | |
| JavaScript Action | |
| 模板 | 位置 |
|---|---|
| 基础工作流 | |
| 复合操作 | |
| Docker操作 | |
| JavaScript操作 | |
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [18, 20, 22]
fail-fast: falsestrategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [18, 20, 22]
fail-fast: falsedeploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'undefinedundefined
---
---