GitHub Actions
Purpose
Turn the ci-cd pipeline design into secure, efficient GitHub Actions workflows — correct triggers, caching, pinned actions, least-privilege permissions, and environment protection for gated deploys — without introducing jobs the design didn't call for.
When to Use
- When the CI platform is GitHub and the
ci-cd design is ready to implement.
- Not for designing the pipeline (
ci-cd) or on non-GitHub platforms.
Inputs
- The
ci-cd job design (app-derived jobs + gates).
- Secret store + environments (
secrets-management, environment-management), repo/monorepo shape.
Discovery Questions
- What triggers each workflow (PR, push to main, tag, manual dispatch)?
- Which jobs need which secrets, and from where (repo/environment secrets)?
- Which deploys need environment protection rules (required reviewers) for approval gating?
Responsibilities
- Implement the designed jobs as workflows/jobs with correct
needs ordering and matrices where useful (Node versions, packages); implement exactly the app-derived set from ci-cd — no invented jobs for absent apps.
- Cache dependencies and build outputs (setup-action caches, Turborepo remote cache if configured —
turborepo-foundation); frozen installs (npm ci/pnpm --frozen-lockfile).
- Pin action versions (by major tag at least, commit SHA for third-party actions) — floating
@main is a supply-chain risk (../../security/dependency-security).
- Apply least-privilege
GITHUB_TOKEN: default read-only permissions, granting write scopes only per job that needs them.
- Source secrets from GitHub secrets / environment secrets (
secrets-management) — never inline; never echo into logs; be mindful of untrusted pull_request_target and fork PRs (don't expose secrets to fork code).
- Gate deploys with GitHub Environments + required reviewers so production deploy jobs pause for approval (
ci-cd, ../../release-planning); run post-deploy smoke (../../testing/smoke-testing).
- Keep workflows DRY (reusable/composite workflows) where the repo has several apps.
Required Workflow
- Map the
ci-cd jobs to workflows + triggers.
- Implement jobs with
needs ordering + matrices; frozen installs + caching.
- Pin all actions; set least-privilege
permissions.
- Wire secrets from the store; guard fork/PR secret exposure.
- Add environment protection rules for gated deploys + post-deploy smoke.
Decision Rules
- Implement only the designed, app-derived jobs — the platform layer doesn't invent scope.
- Default
permissions: read-all; escalate per job, never globally to write.
- Pin third-party actions to a SHA; a hijacked floating tag runs arbitrary code with your token/secrets.
- Never expose secrets to untrusted fork PR code (
pull_request_target care).
- Production deploys pass through an Environment with required reviewers.
Rules
- Actions pinned;
GITHUB_TOKEN least-privilege.
- Secrets from the store, never logged or inlined.
- Deploy jobs approval-gated via Environments.
Anti-Patterns
- Adding workflow jobs for apps the project doesn't have.
uses: some/action@main (unpinned third-party).
- Global
permissions: write-all.
- Secrets echoed in logs or exposed to fork PRs.
- Auto-deploy to production with no environment approval.
Validation Checklist
Definition of Done
The ci-cd design implemented as GitHub Actions workflows — correctly ordered cached jobs, pinned actions, least-privilege token, store-sourced secrets, and environment-protected approval-gated deploys — matching the app-derived job set exactly.
Related Skills
ci-cd, secrets-management, environment-management, turborepo-foundation, deployment-selection, ../../testing/smoke-testing, ../../security/dependency-security, ../../release-planning, ../../github-repository.
Related Knowledge
../../../knowledge/ (triggers, environments, reviewers).
Related References
../../../references/devops/ (workflow patterns, when populated).
Context Loading Guidance
- Requires: the
ci-cd job design, secret store + environments, repo shape.
- Does not require: re-deciding the pipeline scope, app feature code.
- May load:
secrets-management, deployment-selection.
- Stop when: workflows implement the design with security + gates in place.
Token Efficiency Guidance
Work from the ci-cd job matrix; the workflow is its implementation. Keep YAML discussion to triggers, permissions, and gates.
1---2name: github-actions3description: Use to implement the designed CI/CD pipeline as GitHub Actions workflows — jobs/matrices, dependency + build caching, pinned action versions, least-privilege GITHUB_TOKEN, secrets from the store, environment protection rules for approval-gated deploys. Implements the ci-cd design; adds no jobs for nonexistent apps.4---56# GitHub Actions78## Purpose910Turn the `ci-cd` pipeline design into secure, efficient GitHub Actions workflows — correct triggers, caching, pinned actions, least-privilege permissions, and environment protection for gated deploys — without introducing jobs the design didn't call for.1112## When to Use1314- When the CI platform is GitHub and the `ci-cd` design is ready to implement.15- **Not** for designing the pipeline (`ci-cd`) or on non-GitHub platforms.1617## Inputs1819- The `ci-cd` job design (app-derived jobs + gates).20- Secret store + environments (`secrets-management`, `environment-management`), repo/monorepo shape.2122## Discovery Questions2324- What triggers each workflow (PR, push to main, tag, manual dispatch)?25- Which jobs need which secrets, and from where (repo/environment secrets)?26- Which deploys need **environment protection rules** (required reviewers) for approval gating?2728## Responsibilities2930- Implement the **designed jobs** as workflows/jobs with correct `needs` ordering and **matrices** where useful (Node versions, packages); implement exactly the app-derived set from `ci-cd` — no invented jobs for absent apps.31- **Cache** dependencies and build outputs (setup-action caches, Turborepo remote cache if configured — `turborepo-foundation`); frozen installs (`npm ci`/`pnpm --frozen-lockfile`).32- **Pin action versions** (by major tag at least, commit SHA for third-party actions) — floating `@main` is a supply-chain risk (`../../security/dependency-security`).33- Apply **least-privilege `GITHUB_TOKEN`**: default read-only `permissions`, granting `write` scopes only per job that needs them.34- Source **secrets from GitHub secrets / environment secrets** (`secrets-management`) — never inline; never echo into logs; be mindful of untrusted `pull_request_target` and fork PRs (don't expose secrets to fork code).35- Gate deploys with **GitHub Environments + required reviewers** so production deploy jobs pause for approval (`ci-cd`, `../../release-planning`); run **post-deploy smoke** (`../../testing/smoke-testing`).36- Keep workflows DRY (reusable/composite workflows) where the repo has several apps.3738## Required Workflow39401. Map the `ci-cd` jobs to workflows + triggers.412. Implement jobs with `needs` ordering + matrices; frozen installs + caching.423. Pin all actions; set least-privilege `permissions`.434. Wire secrets from the store; guard fork/PR secret exposure.445. Add environment protection rules for gated deploys + post-deploy smoke.4546## Decision Rules4748- Implement only the designed, app-derived jobs — the platform layer doesn't invent scope.49- Default `permissions: read-all`; escalate per job, never globally to write.50- Pin third-party actions to a SHA; a hijacked floating tag runs arbitrary code with your token/secrets.51- Never expose secrets to untrusted fork PR code (`pull_request_target` care).52- Production deploys pass through an Environment with required reviewers.5354## Rules5556- Actions pinned; `GITHUB_TOKEN` least-privilege.57- Secrets from the store, never logged or inlined.58- Deploy jobs approval-gated via Environments.5960## Anti-Patterns6162- Adding workflow jobs for apps the project doesn't have.63- `uses: some/action@main` (unpinned third-party).64- Global `permissions: write-all`.65- Secrets echoed in logs or exposed to fork PRs.66- Auto-deploy to production with no environment approval.6768## Validation Checklist6970- [ ] Designed jobs implemented (no extras for absent apps).71- [ ] `needs` ordering + matrices; frozen installs + caching.72- [ ] Actions pinned; least-privilege `GITHUB_TOKEN`.73- [ ] Secrets from store; fork/PR exposure guarded.74- [ ] Environment protection for gated deploys + post-deploy smoke.7576## Definition of Done7778The `ci-cd` design implemented as GitHub Actions workflows — correctly ordered cached jobs, pinned actions, least-privilege token, store-sourced secrets, and environment-protected approval-gated deploys — matching the app-derived job set exactly.7980## Related Skills8182`ci-cd`, `secrets-management`, `environment-management`, `turborepo-foundation`, `deployment-selection`, `../../testing/smoke-testing`, `../../security/dependency-security`, `../../release-planning`, `../../github-repository`.8384## Related Knowledge8586`../../../knowledge/` (triggers, environments, reviewers).8788## Related References8990`../../../references/devops/` (workflow patterns, when populated).9192## Context Loading Guidance9394- **Requires:** the `ci-cd` job design, secret store + environments, repo shape.95- **Does not require:** re-deciding the pipeline scope, app feature code.96- **May load:** `secrets-management`, `deployment-selection`.97- **Stop when:** workflows implement the design with security + gates in place.9899## Token Efficiency Guidance100101Work from the `ci-cd` job matrix; the workflow is its implementation. Keep YAML discussion to triggers, permissions, and gates.