Skip to main content

implement-workflow

Use when: adding or materially changing GitHub Actions workflows, CI jobs, workflow scripts, artifacts, matrices, permissions, or provider integration.

来源信息

仓库
torrust/torrust-tracker
最近来源活动
2026年9月28日 12:20
检测到的 SKILL.md 语言
英语
星标
532
分支
56

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
implement-workflow
description
Use when: adding or materially changing GitHub Actions workflows, CI jobs, workflow scripts, artifacts, matrices, permissions, or provider integration.
metadata
{"author":"torrust","version":"1.0"}
# Implement CI Workflows ## Rule Keep CI workflow definitions as thin platform adapters. Put non-trivial decisions, data transformation, validation, and report rendering in repository-owned tools with a documented command-line interface and automated tests. Prefer Rust for that logic unless another implementation language is justified. Workflow files may retain only provider-specific triggering, permissions, runner setup, checkout, scheduling, artifact transport, and the small adapter calls needed to invoke the tool. Document unavoidable provider-specific behavior and the practical portable alternative. ## Design The Boundary Before editing a workflow, identify which behavior is provider-specific and which is repository behavior. - Keep triggering, permissions, runner selection, pinned action setup, immutable revision checkout, matrix scheduling, artifact transport, and provider outputs in the workflow. - Move decisions, parsing, validation, aggregation, numeric calculations, and report formatting into a repository-owned tool when they are more than simple orchestration. - Give repository tools ordinary command-line arguments, standard input or JSON files, and standard output. Do not require GitHub environment variables or GitHub output files in tool interfaces. - Document unavoidable provider behavior and name the practical portable alternative in the owning tool, workflow, or skill. ## Implement Safely 1. Preserve the existing trust boundary before changing workflow behavior. Use least-privilege permissions and do not expose secrets to untrusted pull request code. 2. Pin actions to the repository's established versioning convention. Use immutable pull request revisions when base/head behavior is compared. 3. Keep shell only for simple adapter work such as command invocation, output assignment, and artifact paths. Move substantive shell loops, `jq`/`awk` transformations, or presentation logic into tested repository tooling. 4. Add focused automated tests for repository-tool behavior. Test the tool's portable contract separately from provider orchestration. 5. Validate the workflow YAML locally, then obtain hosted evidence for provider-only behavior such as permissions, matrix expansion, artifacts, and fork pull requests. ## Validate Run the narrowest checks applicable to the changed surface first: ```bash linter yaml git diff --check ``` For repository tooling, also run its focused formatter, tests, and strict linting. Before committing, run the repository pre-commit gate. Record hosted workflow evidence separately when it cannot be reproduced locally. ## Skill Links - `.github/workflows/AGENTS.md` - `.github/workflows/generate_coverage_pr.yaml` ## Related Guidance - [Root repository instructions](../../../../../AGENTS.md) define the repository-wide shell-versus-Rust threshold. - [Workflow-local instructions](../../../../workflows/AGENTS.md) define local GitHub Actions constraints.
在 GitHub 查看