github-actions
Use when creating GitHub Actions workflows for CI/CD - testing, building, publishing npm packages, and automating repository tasks
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when creating GitHub Actions workflows for CI/CD - testing, building, publishing npm packages, and automating repository tasks
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | github-actions |
| description | Use when creating GitHub Actions workflows for CI/CD - testing, building, publishing npm packages, and automating repository tasks |
# .github/workflows/ci.yml
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm test
strategy:
matrix:
node-version: [18, 20, 22]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
| Event | Usage |
|---|---|
push | On push to branches |
pull_request | On PR open/update |
release | On release publish |
workflow_dispatch | Manual trigger |
schedule | Cron schedule |
# Conditional steps
- run: npm publish
if: github.event_name == 'release'
# Job dependencies
jobs:
build:
# ...
deploy:
needs: build
# Environment variables
env:
CI: true
NODE_ENV: test
# Secrets
${{ secrets.MY_SECRET }}
npm ci (not npm install) for reproducible buildsactions/setup-node cache optionworkflow_dispatch inputs for manual parametersconcurrency to cancel in-progress runs on new pushesUse when writing or editing .omg.md files - the human-first DSL for API specification that compiles to OpenAPI 3.1
Use when building CLI tools with Commander.js - commands, options, arguments, and help text for Node.js command-line applications
Use when parsing or generating Markdown following the CommonMark specification - AST structure, block/inline elements, and extensions
Use when working with JSON Schema for validation, OpenAPI schemas, type definitions, and data structure specification
Use when implementing Language Server Protocol features - diagnostics, completions, hover, go-to-definition, and editor integration
Use when managing npm workspaces monorepos - package dependencies, build ordering, cross-package development, and publishing workflows