Loading...
Loading...
CI/CD and GitHub Actions guidelines. Use when writing workflows or Actions. Shell script code must be in dedicated .sh or .py files. Actions must be pinned to SHAs, not versions.
npx skill4agent add lgtm-hq/ai-skills stand-ci.sh.pyscripts/# WRONG - version tag (can be moved, vulnerable to supply chain attacks)
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
# CORRECT - pinned to SHA (immutable, secure)
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0# WRONG - inline script in workflow
jobs:
build:
steps:
- name: Build and deploy
run: |
echo "Building..."
npm install
npm run build
if [ -f dist/index.js ]; then
aws s3 sync dist/ s3://bucket/
fi
# CORRECT - reference external script
jobs:
build:
steps:
- name: Build and deploy
run: ./scripts/ci/build-and-deploy.shscripts/
└── ci/
├── build.sh
├── deploy.sh
├── test.sh
└── utils/
└── helpers.pychmod +x#!/usr/bin/env bash#!/usr/bin/env python3verify-X-sync.pygenerate-X.py--checkpostUpgradeTasks--check# WRONG — verify two files agree
- run: python3 scripts/ci/verify-manifest-sync.py
- run: python3 scripts/ci/verify-tool-version-sync.py
# CORRECT — single generator, single check
- run: python3 scripts/ci/generate-tool-versions.py --check