Skip to content

fix: protect activity.log from deletion in cleanupLogFiles #435

fix: protect activity.log from deletion in cleanupLogFiles

fix: protect activity.log from deletion in cleanupLogFiles #435

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:
# Enable CodeQL permissions for this workflow
permissions:
security-events: write
actions: read
contents: read
# Disable CodeQL
env:
CODEQL_ACTION_DISABLE: true
CODEQL_ACTION_FEATURE_MULTI_LANGUAGE: false
CODEQL_ACTION_FEATURE_SARIF_COMBINE: false
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.19.6]
steps:
- name: Disable CodeQL
run: |
echo "CODEQL_DISABLED=true" >> $GITHUB_ENV
# Kill any existing CodeQL processes
pkill -f codeql || true
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run postinstall configuration
run: npm run postinstall
- name: Validate postinstall files
run: node scripts/mjs/test-postinstall-files.mjs
- name: Setup CI paths
run: node scripts/node/setup-ci-paths.cjs
- name: TypeScript type check
run: npm run typecheck
- name: Lint code
run: npm run lint
- name: Build project
run: npm run build:all
- name: Run unit tests
run: |
npm run test:unit || (echo "Retrying with clean install..." && rm -rf node_modules package-lock.json && npm install --ignore-scripts && npm run test:unit)
- name: Run integration tests
run: npm run test:integration
- name: Run security audit
run: npm run security-audit
build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Disable CodeQL
run: |
echo "CODEQL_DISABLED=true" >> $GITHUB_ENV
pkill -f codeql || true
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.19"
cache: "npm"
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Build plugin
run: npm run build
- name: Build all
run: npm run build:all
- name: Validate package
run: npm pack --dry-run
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: strray-ai-build
path: dist/
retention-days: 30
publish:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- name: Disable CodeQL
run: |
echo "CODEQL_DISABLED=true" >> $GITHUB_ENV
pkill -f codeql || true
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.19"
cache: "npm"
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Build for publish
run: npm run build
# NPM Orchestration Test - disabled, run manually if needed
# npm-orchestration-test:
# runs-on: ubuntu-latest
# needs: test
# if: github.event_name == 'push' || github.event_name == 'pull_request'
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Setup Node.js 20.x
# uses: actions/setup-node@v4
# with:
# node-version: 20.x
# cache: npm
# - name: Run CI NPM Orchestration Test
# run: bash scripts/bash/ci-npm-orchestration-test.sh
# timeout-minutes: 10
# env:
# PROJECT_DIR: ${{ github.workspace }}
# - name: Upload test artifacts on failure
# if: failure()
# uses: actions/upload-artifact@v4
# with:
# name: npm-test-logs-${{ github.run_id }}
# path: /tmp/strray-ci-test-*/logs/
- name: Run CI NPM Orchestration Test
run: bash scripts/bash/ci-npm-orchestration-test.sh
timeout-minutes: 10
env:
PROJECT_DIR: ${{ github.workspace }}
- name: Upload test artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: npm-test-logs-${{ github.run_id }}
path: /tmp/strray-ci-test-*/logs/
retention-days: 7
- name: Comment PR on failure
if: failure() && github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ **NPM Orchestration Test Failed**\n\nThe npm package installation and/or path transformation failed.\n\nPlease check:\n1. Postinstall script transforms paths correctly\n2. Plugin paths point to node_modules/strray-ai/\n3. MCP server paths are transformed\n\nSee workflow logs for details.'
})