github-actions
4
总安装量
2
周安装量
#54149
全站排名
安装命令
npx skills add https://github.com/yldgio/codereview-skills --skill github-actions
Agent 安装分布
opencode
2
Skill 文档
GitHub Actions Code Review Rules
Security
- Pin actions to full commit SHA (not
@v1or@main) - Use minimal
permissionsblock (principle of least privilege) - Never echo secrets or use them in URLs
- Use
secrets.GITHUB_TOKENinstead of PATs when possible - Audit third-party actions before use
Permissions
permissions:
contents: read # Minimal by default
# Add only what's needed:
# pull-requests: write
# issues: write
Secrets
- Store secrets in repository/organization secrets
- Use environments for production secrets with approvals
- Don’t pass secrets as command arguments (visible in logs)
- Mask sensitive output with
::add-mask::
Performance
- Use caching for dependencies (
actions/cacheor built-in) - Run independent jobs in parallel
- Use
concurrencyto cancel redundant runs - Consider self-hosted runners for heavy workloads
Workflow Structure
- Use reusable workflows for common patterns
- Use composite actions for shared steps
- Set appropriate
timeout-minutesto prevent hung jobs - Use
if:conditions to skip unnecessary jobs
Triggers
- Be specific with
pathsandbranchesfilters - Use
workflow_dispatchfor manual triggers - Consider
pull_request_targetsecurity implications
Common Anti-patterns
- Avoid
actions/checkoutwithpersist-credentials: trueunless needed - Avoid running on
pushto all branches - Avoid hardcoding versions that need updates