Skip to content

Commit 8cc806a

Browse files
committed
docs: add GitHub Actions & workflow design guidelines to AGENTS.md
Specify preferences for native tooling: - GitHub Actions features, git CLI, and gh CLI over third-party actions - Artifact reuse across workflows for cost efficiency and speed - Error handling with dependency validation - Explicit job ordering with needs: clauses Benefits established patterns for future workflow improvements
1 parent bd9977e commit 8cc806a

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,24 @@
4949
## Data Validation
5050
- **REQUIRED:** The CSV output must precisely match the format and header order of blackbox_decode CSV files.
5151

52+
## GitHub Actions & Workflow Design
53+
- **Native Tooling First:** Prefer native GitHub Actions features, `git` CLI, and `gh` (GitHub CLI) over third-party actions or custom scripting.
54+
- Use `gh run list`, `gh run download`, `gh release upload`, `gh release edit` for automation
55+
- Leverage GitHub Actions built-in context (`github.sha`, `github.ref_name`, `github.token`) instead of external tooling
56+
- Built-in authentication via `GITHUB_TOKEN` eliminates need for additional secrets
57+
- **Artifact Reuse:** Design workflows to reuse artifacts across jobs:
58+
- Build once in ci.yml (triggered on push/tags)
59+
- Download and reuse in release.yml or other downstream workflows
60+
- Reduces CI costs and accelerates release cycles (~8-10x faster)
61+
- **Error Handling:** Workflows should validate dependencies before proceeding:
62+
- Verify upstream jobs succeeded (e.g., ci.yml completed before release.yml downloads)
63+
- Provide clear error messages if expected artifacts unavailable
64+
- Use `set -e` in shell scripts to fail fast on errors
65+
- **Dependency Management:** Use explicit `needs:` clauses for job ordering:
66+
- Clear workflow visualization in GitHub Actions UI
67+
- Prevents race conditions and dependency issues
68+
- Makes workflow intent unambiguous
69+
5270
## Committing Rules
5371
- **Commit Conditions:** Only commit if:
5472
- `cargo clippy --all-targets --all-features -- -D warnings` passes.

0 commit comments

Comments
 (0)