用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mitkox/ai-coding-factory --skill net-github-actions命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | net-github-actions |
| description | Create GitHub Actions CI/CD pipelines for .NET applications |
| license | MIT |
| compatibility | opencode |
| metadata | {"audience":".net-developers","cicd":"github-actions","framework":"dotnet"} |
I create complete CI/CD pipelines:
Use this skill when:
name: Build and Test
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Run unit tests
run: dotnet test ./tests/ProjectName.UnitTests --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage"
- name: Run integration tests
run: dotnet test ./tests/ProjectName.IntegrationTests --configuration Release --no-build --verbosity normal
- name: Generate coverage report
uses: danielpalme/ReportGenerator-GitHub-Action@v6
with:
reports: '**/coverage.cobertura.xml'
targetdir: coveragereport
- name: Upload coverage reports
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coveragereport/
- name: Check coverage threshold
run: |
coverage=$(grep '<LineCoverage>' coveragereport/CoverageReport.xml | sed -E 's/<[^>]*>//g' | cut -d. -f1)
if [ $coverage -lt 80 ]; then
echo "Coverage below 80%: $coverage%"
exit 1
fi
name: Security Scan
on:
push:
branches: [ main ]
schedule:
- cron: '0 0 * * 0' # Weekly
jobs:
security:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run NuGet vulnerability scan
run: dotnet list package --vulnerable
- name: Run OWASP Dependency Check
uses: dependency-check/Dependency-Check_Action@main
with:
project: '.'
path: '.'
format: 'HTML'
- name: Upload security report
uses: actions/upload-artifact@v4
name: Build and Push Docker Image
on:
push:
branches: [ main ]
tags:
- 'v*'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id:
name: Deploy to Staging
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: staging
url: https://staging.example.com
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy to staging
uses: azure/webapps-deploy@v3
with:
app-name: 'your-app-name-staging'
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_STAGING }}
images: 'ghcr.io/${{ github.repository }}:latest'
- name: Health check
run: |
for i in {1..10}; do
if curl -f https://staging.example.com/health; then
echo "Health check passed"
exit 0
fi
echo "Retry $i/10"
sleep 10
done
echo "Health check failed"
exit 1
name: Deploy to Production
on:
push:
tags:
- 'v*'
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: production
url: https://example.com
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
- name: Deploy to production
uses: azure/webapps-deploy@v3
with:
app-name: 'your-app-name-prod'
# GitHub Secrets
GITHUB_TOKEN
AZURE_WEBAPP_PUBLISH_PROFILE_STAGING
AZURE_WEBAPP_PUBLISH_PROFILE_PROD
SLACK_WEBHOOK
SONARQUBE_TOKEN
Create GitHub Actions workflows for:
- Build and test (unit + integration)
- Security scanning (NuGet, OWASP)
- Docker image build and push
- Deploy to staging
- Deploy to production (with approval)
I will generate complete CI/CD pipelines.