Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: CodeQL config

paths-ignore:
- node_modules
- dist
- coverage
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 2

updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
day: monday
timezone: America/Chicago
groups:
npm-minor-patch:
update-types: [minor, patch]
commit-message:
prefix: "deps(npm):"

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
day: monday
timezone: America/Chicago
groups:
actions:
update-types: [minor, patch]
commit-message:
prefix: "deps(actions):"
31 changes: 31 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
adapters:
- changed-files:
- any-glob-to-any-file: src/adapters/**

inbound:
- changed-files:
- any-glob-to-any-file: src/inbound/**

outbound:
- changed-files:
- any-glob-to-any-file: src/outbound/**

tests:
- changed-files:
- any-glob-to-any-file: tests/**

ci:
- changed-files:
- any-glob-to-any-file: .github/**

docs:
- changed-files:
- any-glob-to-any-file:
- docs/**
- "*.md"

config:
- changed-files:
- any-glob-to-any-file:
- src/config*.ts
- openclaw.plugin.json
66 changes: 61 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,71 @@ on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
check:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 22
node-version: 22.5
cache: npm
- run: npm ci
Comment thread
jeremy marked this conversation as resolved.
- run: npm run typecheck

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 22.5
cache: npm
- run: npm ci
- run: npm run lint
- run: npm test
- uses: rhysd/actionlint@a443f344ff32813837fa49f7aa6cbc478d770e62 # v1.7.9
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name == 'pull_request'

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 22.5
cache: npm
- run: npm ci
- run: npm test -- --coverage
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: coverage
path: coverage/
if: always()

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 22.5
cache: npm
- run: npm ci
- run: npm run build
- name: Verify build output
run: |
test -f dist/index.js || { echo "dist/index.js missing"; exit 1; }
test -f dist/index.d.ts || { echo "dist/index.d.ts missing"; exit 1; }

dependency-review:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
continue-on-error: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
26 changes: 26 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Dependabot auto-merge

on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0
id: meta
- name: Auto-approve and merge npm patch/minor updates
if: >-
steps.meta.outputs.package-ecosystem == 'npm_and_yarn' &&
(steps.meta.outputs.update-type == 'version-update:semver-patch' ||
steps.meta.outputs.update-type == 'version-update:semver-minor')
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Labeler

on:
pull_request_target:
types: [opened, synchronize]

permissions:
contents: read
pull-requests: write

jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
with:
sync-labels: true
95 changes: 95 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Release

on:
push:
tags: ["v*"]

permissions:
contents: write
id-token: write

concurrency:
group: release
cancel-in-progress: false

jobs:
security:
uses: ./.github/workflows/security.yml
permissions:
contents: read
security-events: write
secrets: inherit

Comment thread
jeremy marked this conversation as resolved.
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 22.5
cache: npm
- run: npm ci
Comment thread
jeremy marked this conversation as resolved.
- run: npm run typecheck
- run: npm run lint
- run: npm test
- run: npm run build
- name: Verify build output
run: |
test -f dist/index.js || { echo "dist/index.js missing"; exit 1; }
test -f dist/index.d.ts || { echo "dist/index.d.ts missing"; exit 1; }

publish:
needs: [security, test]
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 22.5
cache: npm
registry-url: https://registry.npmjs.org
- name: Verify tag is on main
run: |
# Dereference GITHUB_SHA to a commit in case it is an annotated tag
COMMIT_SHA="$(git rev-parse "${GITHUB_SHA}^{commit}")"
git merge-base --is-ancestor "$COMMIT_SHA" origin/main
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Validate tag matches package.json
run: |
PKG_VERSION="$(node -p "require('./package.json').version")"
TAG_VERSION="${GITHUB_REF_NAME#v}"
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
echo "::error::Tag version ($TAG_VERSION) does not match package.json ($PKG_VERSION)"
exit 1
fi
- name: Check if version already published
id: check
run: |
if npm view "@37signals/openclaw-basecamp@${{ steps.version.outputs.version }}" version 2>/dev/null; then
Comment thread
jeremy marked this conversation as resolved.
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm ci
- run: npm run build
- name: Publish to npm
if: steps.check.outputs.exists == 'false'
run: |
TAG_FLAG=""
if [[ "${{ steps.version.outputs.version }}" == *-* ]]; then
TAG_FLAG="--tag next"
fi
npm publish --provenance $TAG_FLAG
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
generate_release_notes: true
prerelease: ${{ contains(steps.version.outputs.version, '-') }}
67 changes: 67 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Security

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 6 * * 1" # Monday 6am UTC
workflow_call:

permissions:
contents: read
security-events: write

jobs:
npm-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 22.5
cache: npm
- run: npm ci
- run: npm audit --audit-level=high

trivy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # 0.35.0
with:
scan-type: fs
severity: HIGH,CRITICAL
ignore-unfixed: true
exit-code: "1"
format: sarif
output: trivy-results.sarif
- uses: github/codeql-action/upload-sarif@820e3160e279568db735cee8ed8f8e77a6da7818 # v3
with:
sarif_file: trivy-results.sarif
if: always()
continue-on-error: true

codeql:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: github/codeql-action/init@820e3160e279568db735cee8ed8f8e77a6da7818 # v3
with:
languages: javascript
queries: security-and-quality
config-file: .github/codeql/codeql-config.yml
- uses: github/codeql-action/analyze@820e3160e279568db735cee8ed8f8e77a6da7818 # v3
continue-on-error: true

gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2.3.9
env:
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
continue-on-error: true
Comment thread
jeremy marked this conversation as resolved.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules/
dist/
coverage/
*.tsbuildinfo
.env
.env.*
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
Loading
Loading