Add GitHub Actions automations
- Security scanning (CodeQL, dependency review, secrets) - Railway auto-deploy on push to main - Release automation with Docker image publishing - Health check monitoring - PR labeler and Dependabot 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
46
.github/dependabot.yml
vendored
Normal file
46
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "npm"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
day: "monday"
|
||||||
|
time: "06:00"
|
||||||
|
timezone: "America/Los_Angeles"
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
commit-message:
|
||||||
|
prefix: "deps"
|
||||||
|
include: "scope"
|
||||||
|
labels:
|
||||||
|
- "dependencies"
|
||||||
|
- "automated"
|
||||||
|
groups:
|
||||||
|
dev-dependencies:
|
||||||
|
dependency-type: "development"
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
production-dependencies:
|
||||||
|
dependency-type: "production"
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
day: "monday"
|
||||||
|
commit-message:
|
||||||
|
prefix: "ci"
|
||||||
|
labels:
|
||||||
|
- "ci/cd"
|
||||||
|
- "automated"
|
||||||
|
|
||||||
|
- package-ecosystem: "docker"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
commit-message:
|
||||||
|
prefix: "docker"
|
||||||
|
labels:
|
||||||
|
- "docker"
|
||||||
|
- "automated"
|
||||||
56
.github/labeler.yml
vendored
Normal file
56
.github/labeler.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
# Label configuration for PR Labeler action
|
||||||
|
|
||||||
|
agents:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file: 'agents/**/*'
|
||||||
|
|
||||||
|
cognition:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file: 'cognition/**/*'
|
||||||
|
|
||||||
|
capabilities:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file: 'capabilities/**/*'
|
||||||
|
|
||||||
|
guardrails:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file: 'guardrails/**/*'
|
||||||
|
|
||||||
|
documentation:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- 'docs/**/*'
|
||||||
|
- '*.md'
|
||||||
|
- 'README*'
|
||||||
|
|
||||||
|
ci/cd:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- '.github/**/*'
|
||||||
|
- 'Dockerfile'
|
||||||
|
- 'docker-compose*.yml'
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- 'package.json'
|
||||||
|
- 'package-lock.json'
|
||||||
|
- 'pnpm-lock.yaml'
|
||||||
|
- 'yarn.lock'
|
||||||
|
|
||||||
|
config:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- '*.config.*'
|
||||||
|
- '*.json'
|
||||||
|
- '*.yaml'
|
||||||
|
- '*.yml'
|
||||||
|
- '*.toml'
|
||||||
|
|
||||||
|
tests:
|
||||||
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- '**/*.test.*'
|
||||||
|
- '**/*.spec.*'
|
||||||
|
- '__tests__/**/*'
|
||||||
|
- 'test/**/*'
|
||||||
65
.github/workflows/pr-labeler.yml
vendored
Normal file
65
.github/workflows/pr-labeler.yml
vendored
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
name: PR Labeler
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, edited, synchronize]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
label:
|
||||||
|
name: Label PR
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Label based on files changed
|
||||||
|
uses: actions/labeler@v5
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
configuration-path: .github/labeler.yml
|
||||||
|
|
||||||
|
- name: Label based on PR size
|
||||||
|
uses: codelytv/pr-size-labeler@v1
|
||||||
|
with:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
xs_label: 'size/xs'
|
||||||
|
xs_max_size: 10
|
||||||
|
s_label: 'size/s'
|
||||||
|
s_max_size: 100
|
||||||
|
m_label: 'size/m'
|
||||||
|
m_max_size: 500
|
||||||
|
l_label: 'size/l'
|
||||||
|
l_max_size: 1000
|
||||||
|
xl_label: 'size/xl'
|
||||||
|
fail_if_xl: false
|
||||||
|
|
||||||
|
- name: Label based on title
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const title = context.payload.pull_request.title.toLowerCase();
|
||||||
|
const labels = [];
|
||||||
|
|
||||||
|
if (title.includes('fix') || title.includes('bug')) labels.push('bug');
|
||||||
|
if (title.includes('feat') || title.includes('feature')) labels.push('enhancement');
|
||||||
|
if (title.includes('docs') || title.includes('documentation')) labels.push('documentation');
|
||||||
|
if (title.includes('refactor')) labels.push('refactor');
|
||||||
|
if (title.includes('test')) labels.push('testing');
|
||||||
|
if (title.includes('ci') || title.includes('workflow')) labels.push('ci/cd');
|
||||||
|
if (title.includes('security')) labels.push('security');
|
||||||
|
if (title.includes('breaking')) labels.push('breaking-change');
|
||||||
|
if (title.includes('wip') || title.includes('draft')) labels.push('work-in-progress');
|
||||||
|
|
||||||
|
if (labels.length > 0) {
|
||||||
|
await github.rest.issues.addLabels({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: context.payload.pull_request.number,
|
||||||
|
labels: labels
|
||||||
|
});
|
||||||
|
}
|
||||||
94
.github/workflows/release.yml
vendored
Normal file
94
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: Create Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: npm run build --if-present
|
||||||
|
|
||||||
|
- name: Generate changelog
|
||||||
|
id: changelog
|
||||||
|
uses: metcalfc/changelog-generator@v4.3.1
|
||||||
|
with:
|
||||||
|
myToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
body: |
|
||||||
|
## What's Changed
|
||||||
|
${{ steps.changelog.outputs.changelog }}
|
||||||
|
|
||||||
|
## Docker Image
|
||||||
|
```
|
||||||
|
docker pull ghcr.io/${{ github.repository }}:${{ github.ref_name }}
|
||||||
|
```
|
||||||
|
draft: false
|
||||||
|
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
docker:
|
||||||
|
name: Build and Push Docker Image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: release
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ghcr.io/${{ github.repository }}
|
||||||
|
tags: |
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=sha
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
68
.github/workflows/security-scan.yml
vendored
Normal file
68
.github/workflows/security-scan.yml
vendored
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
name: Security Scan
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, master]
|
||||||
|
pull_request:
|
||||||
|
branches: [main, master]
|
||||||
|
schedule:
|
||||||
|
- cron: '0 6 * * 1' # Weekly on Monday at 6am UTC
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
actions: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
codeql:
|
||||||
|
name: CodeQL Analysis
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: ['javascript', 'typescript']
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v3
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v3
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v3
|
||||||
|
with:
|
||||||
|
category: "/language:${{ matrix.language }}"
|
||||||
|
|
||||||
|
dependency-review:
|
||||||
|
name: Dependency Review
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Dependency Review
|
||||||
|
uses: actions/dependency-review-action@v4
|
||||||
|
with:
|
||||||
|
fail-on-severity: high
|
||||||
|
deny-licenses: GPL-3.0, AGPL-3.0
|
||||||
|
|
||||||
|
secrets-scan:
|
||||||
|
name: Secret Scanning
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: TruffleHog OSS
|
||||||
|
uses: trufflesecurity/trufflehog@main
|
||||||
|
with:
|
||||||
|
extra_args: --only-verified
|
||||||
Reference in New Issue
Block a user