Objective
Integrate zizmor and actionlint into the CI/CD pipeline to automatically catch security and code quality issues before they reach production.
Context
Current State: Manual static analysis via scheduled workflow
Goal: Prevent security issues at PR time with automated checks
Tools: zizmor (security), actionlint (linting + shellcheck)
Automated security scanning provides continuous protection by:
- Blocking PRs with High/Critical security findings
- Catching shellcheck issues during development
- Providing immediate feedback to contributors
- Reducing manual security review burden
Approach
Phase 1: Add Pre-commit Hooks (Local Development)
- Create
.pre-commit-config.yaml in repository root
- Configure hooks for:
- zizmor (security scanning)
- actionlint (workflow linting)
- shellcheck (shell script validation)
- Document setup in DEVGUIDE.md
- Make it optional but recommended for contributors
Phase 2: Add CI/CD Checks (Required for PRs)
- Create new workflow:
.github/workflows/security-lint.md
- Configure to run on:
- Pull requests (when workflow files change)
- Push to main branch
- Add job steps:
- Install zizmor and actionlint
- Scan all workflow files
- Report findings as PR comments
- Fail CI for High/Critical issues
- Integrate with GitHub branch protection rules
Phase 3: Enhanced Reporting
- Add actionable error messages with fix suggestions
- Link to security documentation for each finding type
- Generate summary reports for PRs
- Track security metrics over time
Files to Create
.pre-commit-config.yaml (pre-commit hooks configuration)
.github/workflows/security-lint.md (CI security checks)
- Update:
DEVGUIDE.md (document security scanning setup)
- Update:
Makefile (add make security-lint target)
Example Pre-commit Configuration
repos:
- repo: local
hooks:
- id: zizmor
name: zizmor security scan
entry: zizmor
language: system
files: \.github/workflows/.*\.(lock\.yml|md)$
pass_filenames: true
- id: actionlint
name: actionlint workflow linting
entry: actionlint
language: system
files: \.github/workflows/.*\.lock\.yml$
pass_filenames: true
Example CI Workflow (security-lint.md)
---
name: Security Lint
on:
pull_request:
paths:
- '.github/workflows/**'
push:
branches: [main]
permissions:
contents: read
pull-requests: write
---
# Security and Code Quality Checks
This workflow runs automated security scanning and linting on GitHub Actions workflows.
- name: Install tools
run: |
# Install zizmor
curl -sSfL https://github.com/woodruffw/zizmor/releases/latest/download/zizmor-x86_64-unknown-linux-musl -o /usr/local/bin/zizmor
chmod +x /usr/local/bin/zizmor
# Install actionlint
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
- name: Run zizmor security scan
run: |
zizmor --format=sarif .github/workflows/*.lock.yml > zizmor-results.sarif || true
zizmor .github/workflows/*.lock.yml
- name: Run actionlint
run: |
actionlint .github/workflows/*.lock.yml
- name: Check for critical issues
run: |
# Fail CI if High or Critical issues found
if zizmor --format=json .github/workflows/*.lock.yml | jq -e '.[] | select(.severity == "High" or .severity == "Critical")'; then
echo "❌ Critical or High severity security issues found!"
exit 1
fi
Makefile Target
.PHONY: security-lint
security-lint: build recompile ## Run security linting on workflows
@echo "Running zizmor security scan..."
@zizmor .github/workflows/*.lock.yml
@echo "Running actionlint..."
@actionlint .github/workflows/*.lock.yml
Acceptance Criteria
Testing
# Test pre-commit hooks locally
pre-commit install
pre-commit run --all-files
# Test Makefile target
make security-lint
# Test CI workflow (push to test branch)
git checkout -b test-security-lint
git push origin test-security-lint
# Verify workflow runs and reports correctly
Dependencies
This issue should be implemented after fixing:
This ensures the CI won't immediately fail when implemented.
References
AI generated by Plan Command for discussion #9966
Objective
Integrate zizmor and actionlint into the CI/CD pipeline to automatically catch security and code quality issues before they reach production.
Context
Current State: Manual static analysis via scheduled workflow
Goal: Prevent security issues at PR time with automated checks
Tools: zizmor (security), actionlint (linting + shellcheck)
Automated security scanning provides continuous protection by:
Approach
Phase 1: Add Pre-commit Hooks (Local Development)
.pre-commit-config.yamlin repository rootPhase 2: Add CI/CD Checks (Required for PRs)
.github/workflows/security-lint.mdPhase 3: Enhanced Reporting
Files to Create
.pre-commit-config.yaml(pre-commit hooks configuration).github/workflows/security-lint.md(CI security checks)DEVGUIDE.md(document security scanning setup)Makefile(addmake security-linttarget)Example Pre-commit Configuration
Example CI Workflow (security-lint.md)
Makefile Target
Acceptance Criteria
make security-lintaddedTesting
Dependencies
This issue should be implemented after fixing:
This ensures the CI won't immediately fail when implemented.
References
Related to [plan] Security remediation plan for static analysis findings (Jan 14, 2026) #9990