GitHub Actions And Deployment
Portable CI/CD guidance. Load the repository profile for exact workflow names, branches, tags, registries, and publish targets.
Workflow Strategy
| Family | Purpose |
|--------|---------|
| Pull request | Secretless validation for untrusted changes |
| Development branch | Baseline build, test, and quality gate |
| Protected branch | Deeper analysis, scheduled scans, or release readiness |
| Release tag | Build once, scan, publish packages/images, attest artifacts |
| Preview tag | Publish prerelease packages/images with fixed-width preview ordering |
Security Rules
- Use
pull_request, notpull_request_target, when PR code executes. - Keep PR workflows secretless unless the workflow is carefully split between trusted and untrusted code.
- For split-checkout PR workflows, checkout trusted CI/control-plane code at the immutable event base SHA and checkout PR-controlled source into a separate path.
- Use
$/for same-repository actions that should resolve at the running commit. Preserve workspace-relative./references when a split-checkout workflow or its shared composite actions intentionally load trusted code from the checked-out base SHA. - Set explicit
timeout-minuteson jobs that run untrusted or expensive code, and keep aggregate gatekeeper jobs short. - Pin third-party actions to full immutable Git commit SHAs with version comments. Verify tag-to-commit alignment from the official upstream repository. Dereference annotated tags. Container bases require verified registry content digests.
- Protect
.github/workflows/**,.github/actions/**, andCODEOWNERSwith code-owner review. - Gate publishing credentials behind build/test/security-scan success.
- When a quality gate covers multiple languages, collect coverage in the owning jobs. Pass reports as artifacts when they cross jobs and submit one analysis after all required reports are available.
- Upload scanner results when supported. A custom SARIF verifier must fail on missing, empty, malformed, or unparsable results. If platform code-scanning merge protection replaces it, require that protection in branch rulesets.
- Feed global project guidelines to review tools through their guideline-file mechanism instead of duplicating portable rules into long path instructions.
Composite Actions
Composite actions are part of the CI control plane. Review their contracts:
- Inputs are validated and quoted.
- Secrets are passed only to steps that need them.
- Working directories are explicit.
- Tool versions come from profile, lockfiles, or setup actions.
- Outputs are documented and consumed by downstream jobs deliberately.
- Dependency restore steps should not execute third-party lifecycle scripts unless a documented exception is required for production build correctness.
Release Pipeline Checks
- Version is derived from the repository's tag or package metadata.
- Tag filters, version extraction guards, and package/image metadata rules agree on the same stable and preview tag shapes.
- Check branch ancestry with exact refs and
git merge-base --is-ancestor. Branch lists and substring matches are insufficient. - Build artifacts used for packaging are the same artifacts that were scanned or tested.
- If a registry mutates published artifacts, preserve the attested build bytes for consumer verification. For a documented reversible signing mutation, verify the registry signature first. Modify only a copy and require its reconstructed digest to match the attestation. A content-equivalent repack does not prove byte equality.
- Parallelize only when generated-file boundaries are explicit. If package build output, frontend assets, or Docker context files cross job boundaries, add artifact upload/download or keep dependent steps in one job.
- Docker images are built with SBOM/provenance when supported.
- For multi-platform images, bind each platform-specific SBOM to that platform's immutable image manifest digest. Bind an SBOM to the index digest only when the SBOM deliberately and verifiably covers the complete index.
- Package publishing and Docker tag promotion happen after security gates and staged-image CVE scans, not before.
- Registry and package publishing secrets are scoped to the steps or composite actions that need them.
- Dependency-only upgrades are not listed in release notes unless they are breaking, security-relevant, user-facing, or alter published package artifacts.
Docker Standards
When Docker publishing is in scope, verify:
- Dockerfile paths and image names come from the repository profile or workflow files.
- Multi-arch settings match the supported runtime targets.
- Base images use verified digests under the repository's update policy.
- CVE gates match the repository's risk tolerance.
- Promotion reuses scanned image digests when the pipeline supports it.
- SBOM extraction uses the immutable image or platform digest, not a mutable tag that can move after validation.
- Scanner inputs identify the exact image under review, preferably by repository plus staged digest, not runner-local defaults.
- CVE severity filters are explicit. Include
unspecifiedonly when unknown severity intentionally blocks release. - Preview metadata must not overwrite stable tags such as
latestormajor.minor. Derive Docker tags from the extracted release version.
Required Secrets
Document required secrets in the repository profile or deployment docs, not generic skills. Keep names, scopes, and consuming workflows synchronized.
Related Skills
- basic-git-conventions - Branching, tagging, and release-note conventions.
- basic-security-checklist - Security review triggers.