Skip to content
evernote-ci-integration logo

Evernote CI Integration

evernote-ci-integration

Configure CI/CD pipelines for Evernote integrations. Use when setting up automated testing, continuous integration, or deployment pipelines for Evernote projects. Trigger with phrases like "evernote ci", "evernote github actions", "evernote pipeline", "automate evernote tests".

SKILL.md

Full skill instructions

Evernote CI Integration

Overview

Configure continuous integration pipelines for Evernote integrations, including test automation, credential management, and deployment workflows.

Prerequisites

  • Git repository set up
  • CI/​CD platform (GitHub Actions, GitLab CI, etc.)
  • Test suite implemented
  • Sandbox API credentials

Instructions

Step 1: GitHub Actions Workflow

# .github/​workflows/​evernote-ci.yml
name: Evernote Integration CI

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main]

env:
  NODE_VERSION: '20'

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/​checkout@v4

      - name: Setup Node.js
        uses: actions/​setup-node@v4
        with:
          node-version: ${{ env.NODE_VERSION }}
          cache: 'npm'

      - name: Install dependencies
        run: npm ci

      - name: Run linter
        run: npm run lint

  unit-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/​checkout@v4

      - name: Setup Node.js
        uses: actions/​setup-node@v4
        with:
          node-version: ${{ env.NODE_VERSION }}
          cache: 'npm'

      - name: Install dependencies
        run: npm ci

      - name: Run unit tests
        run: npm run test:unit

      - name: Upload coverage
        uses: codecov/​codecov-action@v3
        with:
          files: ./​coverage/​lcov.info

  integration-tests:
    runs-on: ubuntu-latest
    needs: [lint, unit-tests]
    # Only run on main branch to preserve rate limits
    if: github.ref == 'refs/​heads/​main'

    steps:
      - uses: actions/​checkout@v4

      - name: Setup Node.js
        uses: actions/​setup-node@v4
        with:
          node-version: ${{ env.NODE_VERSION }}
          cache: 'npm'

      - name: Install dependencies
        run: npm ci

      - name: Run integration tests
        env:
          EVERNOTE_CONSUMER_KEY: ${{ secrets.EVERNOTE_CONSUMER_KEY }}
          EVERNOTE_CONSUMER_SECRET: ${{ secrets.EVERNOTE_CONSUMER_SECRET }}
          EVERNOTE_ACCESS_TOKEN: ${{ secrets.EVERNOTE_SANDBOX_TOKEN }}
          EVERNOTE_SANDBOX: 'true'
        run: npm run test:integration

  security-scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/​checkout@v4

      - name: Run Snyk security scan
        uses: snyk/​actions/​node@master
        env:
          SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
        with:
          args: --severity-threshold=high

Step 2: Test Configuration

// jest.config.js
module.exports = {
  testEnvironment: 'node',
  testMatch: [
    '**/​tests/​**/​*.test.js'
  ],
  collectCoverageFrom: [
    'src/​**/​*.js',
    '!src/​**/​*.test.js'
  ],
  coverageThreshold: {
    global: {
      branches: 80,
      functions: 80,
      lines: 80,
      statements: 80
    }
  },
  setupFilesAfterEnv: ['./​tests/​setup.js'],

  // Separate test suites
  projects: [
    {
      displayName: 'unit',
      testMatch: ['<rootDir>/​tests/​unit/​**/​*.test.js']
    },
    {
      displayName: 'integration',
      testMatch: ['<rootDir>/​tests/​integration/​**/​*.test.js'],
      testTimeout: 30000
    }
  ]
};
// tests/​setup.js
const dotenv = require('dotenv');

// Load test environment
dotenv.config({ path: '.env.test' });

// Global test setup
beforeAll(() => {
  // Verify test environment
  if (process.env.NODE_ENV === 'production') {
    throw new Error('Cannot run tests in production environment');
  }

  // Ensure sandbox mode for Evernote tests
  if (process.env.EVERNOTE_SANDBOX !== 'true') {
    console.warn('WARNING: EVERNOTE_SANDBOX should be true for tests');
  }
});

// Global teardown
afterAll(async () => {
  // Clean up test resources
});

Step 3: Mock Evernote Client for Unit Tests

// tests/​mocks/​evernote-mock.js

class MockNoteStore {
  constructor() {
    this.notebooks = [];
    this.notes = [];
    this.tags = [];
  }

  async listNotebooks() {
    return this.notebooks;
  }

  async createNotebook(notebook) {
    const created = {
      ...notebook,
      guid: `notebook-${Date.now()}`,
      created: Date.now(),
      updated: Date.now()
    };
    this.notebooks.push(created);
    return created;
  }

  async listTags() {
    return this.tags;
  }

  async createNote(note) {
    // Validate ENML
    if (!note.content.includes('<?xml version="1.0"')) {
      const error = new Error('Invalid ENML');
      error.errorCode = 1;
      error.parameter = 'Note.content';
      throw error;
    }

    const created = {
      ...note,
      guid: `note-${Date.now()}`,
      created: Date.now(),
      updated: Date.now()
    };
    this.notes.push(created);
    return created;
  }

  async getNote(guid, withContent, withResources) {
    const note = this.notes.find(n => n.guid === guid);
    if (!note) {
      const error = new Error('Note not found');
      error.identifier = 'Note.guid';
      error.key = guid;
      throw error;
    }
    return note;
  }

  async findNotesMetadata(filter, offset, maxNotes, spec) {
    let filtered = [...this.notes];

    if (filter.words) {
      const words = filter.words.toLowerCase();
      filtered = filtered.filter(n =>
        n.title.toLowerCase().includes(words) ||
        n.content.toLowerCase().includes(words)
      );
    }

    return {
      notes: filtered.slice(offset, offset + maxNotes),
      totalNotes: filtered.length
    };
  }

  // Reset for tests
  reset() {
    this.notebooks = [];
    this.notes = [];
    this.tags = [];
  }
}

class MockUserStore {
  async getUser() {
    return {
      id: 12345,
      username: 'testuser',
      email: '[email protected]',
      name: 'Test User',
      privilege: 1,
      created: Date.now() - 86400000,
      updated: Date.now(),
      active: true,
      accounting: {
        uploadLimit: 62914560,
        uploaded: 1000000,
        uploadLimitEnd: Date.now() + 86400000 * 30
      }
    };
  }
}

class MockEvernoteClient {
  constructor(options = {}) {
    this.options = options;
    this._noteStore = new MockNoteStore();
    this._userStore = new MockUserStore();
  }

  getNoteStore() {
    return this._noteStore;
  }

  getUserStore() {
    return this._userStore;
  }

  // For OAuth testing
  getRequestToken(callbackUrl, callback) {
    callback(null, 'mock-oauth-token', 'mock-oauth-secret');
  }

  getAuthorizeUrl(oauthToken) {
    return `https://sandbox.evernote.com/​OAuth.action?oauth_token=${oauthToken}`;
  }

  getAccessToken(oauthToken, oauthTokenSecret, oauthVerifier, callback) {
    callback(null, 'mock-access-token', 'mock-access-secret', {
      edam_expires: String(Date.now() + 31536000000)
    });
  }
}

module.exports = {
  MockEvernoteClient,
  MockNoteStore,
  MockUserStore
};

Step 4: Unit Test Examples

// tests/​unit/​note-service.test.js
const { MockEvernoteClient } = require('../​mocks/​evernote-mock');
const NoteService = require('../​../​src/​services/​note-service');

describe('NoteService', () => {
  let noteService;
  let mockClient;

  beforeEach(() => {
    mockClient = new MockEvernoteClient();
    noteService = new NoteService(mockClient.getNoteStore());
  });

  describe('createNote', () => {
    it('should create a note with valid ENML', async () => {
      const result = await noteService.createNote({
        title: 'Test Note',
        content: '<p>Test content</​p>'
      });

      expect(result.guid).toBeDefined();
      expect(result.title).toBe('Test Note');
    });

    it('should sanitize note title', async () => {
      const result = await noteService.createNote({
        title: 'Title\nwith\nnewlines',
        content: '<p>Content</​p>'
      });

      expect(result.title).not.toContain('\n');
    });

    it('should reject invalid ENML', async () => {
      // Remove ENML wrapping for this test
      const badService = {
        noteStore: mockClient.getNoteStore(),
        createNote: async (params) => {
          const note = { title: params.title, content: params.content };
          return mockClient.getNoteStore().createNote(note);
        }
      };

      await expect(
        badService.createNote({
          title: 'Bad Note',
          content: '<p>No ENML wrapper</​p>'
        })
      ).rejects.toMatchObject({
        errorCode: 1,
        parameter: 'Note.content'
      });
    });
  });

  describe('searchNotes', () => {
    beforeEach(async () => {
      // Seed test data
      await noteService.createNote({ title: 'Meeting Notes', content: '<p>Q1 Review</​p>' });
      await noteService.createNote({ title: 'Todo List', content: '<p>Tasks</​p>' });
    });

    it('should find notes by title', async () => {
      const results = await noteService.search('meeting');

      expect(results.notes.length).toBe(1);
      expect(results.notes[0].title).toContain('Meeting');
    });
  });
});

Step 5: Integration Test Examples

// tests/​integration/​evernote-api.test.js
const Evernote = require('evernote');

// Skip if no credentials
const hasCredentials = process.env.EVERNOTE_ACCESS_TOKEN;

(hasCredentials ? describe : describe.skip)('Evernote API Integration', () => {
  let client;
  let noteStore;
  let createdNoteGuids = [];

  beforeAll(() => {
    client = new Evernote.Client({
      token: process.env.EVERNOTE_ACCESS_TOKEN,
      sandbox: process.env.EVERNOTE_SANDBOX === 'true'
    });
    noteStore = client.getNoteStore();
  });

  afterAll(async () => {
    // Clean up created notes
    for (const guid of createdNoteGuids) {
      try {
        await noteStore.deleteNote(guid);
      } catch (error) {
        console.log(`Cleanup: Could not delete ${guid}`);
      }
    }
  });

  it('should authenticate and get user info', async () => {
    const userStore = client.getUserStore();
    const user = await userStore.getUser();

    expect(user.id).toBeDefined();
    expect(user.username).toBeDefined();
  });

  it('should list notebooks', async () => {
    const notebooks = await noteStore.listNotebooks();

    expect(Array.isArray(notebooks)).toBe(true);
    expect(notebooks.length).toBeGreaterThan(0);
  });

  it('should create and retrieve a note', async () => {
    const testTitle = `CI Test Note - ${Date.now()}`;
    const content = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/​pub/​enml2.dtd">
<en-note><p>Integration test content</​p></​en-note>`;

    const note = new Evernote.Types.Note();
    note.title = testTitle;
    note.content = content;

    const created = await noteStore.createNote(note);
    createdNoteGuids.push(created.guid);

    expect(created.guid).toBeDefined();
    expect(created.title).toBe(testTitle);

    // Retrieve and verify
    const retrieved = await noteStore.getNote(created.guid, true, false, false, false);
    expect(retrieved.content).toContain('Integration test content');
  });

  it('should handle rate limits gracefully', async () => {
    // This test intentionally makes multiple calls
    // to verify rate limit handling works

    const promises = [];
    for (let i = 0; i < 5; i++) {
      promises.push(noteStore.listNotebooks());
    }

    const results = await Promise.all(promises);
    expect(results.every(r => Array.isArray(r))).toBe(true);
  }, 30000);
});

Step 6: Secrets Management

# GitHub Actions Secrets Configuration
# Go to Settings > Secrets and variables > Actions

# Required secrets:
# EVERNOTE_CONSUMER_KEY      - Your API consumer key
# EVERNOTE_CONSUMER_SECRET   - Your API consumer secret
# EVERNOTE_SANDBOX_TOKEN     - Sandbox developer token for testing

# Production secrets (separate environment):
# EVERNOTE_PROD_CONSUMER_KEY
# EVERNOTE_PROD_CONSUMER_SECRET
# Using environments for production
# .github/​workflows/​deploy.yml
jobs:
  deploy-production:
    runs-on: ubuntu-latest
    environment: production  # Requires approval

    steps:
      - uses: actions/​checkout@v4

      - name: Deploy
        env:
          EVERNOTE_CONSUMER_KEY: ${{ secrets.EVERNOTE_PROD_CONSUMER_KEY }}
          EVERNOTE_CONSUMER_SECRET: ${{ secrets.EVERNOTE_PROD_CONSUMER_SECRET }}
        run: npm run deploy

Step 7: Package.json Scripts

{
  "scripts": {
    "test": "jest",
    "test:unit": "jest --selectProjects unit",
    "test:integration": "jest --selectProjects integration --runInBand",
    "test:coverage": "jest --coverage",
    "lint": "eslint src/ tests/",
    "lint:fix": "eslint src/ tests/ --fix",
    "typecheck": "tsc --noEmit",
    "ci": "npm run lint && npm run typecheck && npm run test:unit",
    "ci:full": "npm run ci && npm run test:integration"
  }
}

Output

  • GitHub Actions workflow for Evernote CI
  • Comprehensive test configuration
  • Mock client for unit testing
  • Integration test examples
  • Secrets management setup

Best Practices

PracticeReason
Run unit tests on every PRFast feedback, no API usage
Limit integration testsPreserve rate limits
Use sandbox for all CINever test against production
Store secrets securelyProtect API credentials
Clean up test dataDon't leave garbage in sandbox

Resources

Next Steps

For deployment pipelines, see evernote-deploy-integration.

More skills from Dicklesworthstone

environment-setup-guide logo
Dicklesworthstone/pi_agent_rust

environment-setup-guide

Guide developers through setting up development environments with proper tools, dependencies, and configurations

1.8K 0
View
exa-policy-guardrails logo
Dicklesworthstone/pi_agent_rust

exa-policy-guardrails

Implement Exa lint rules, policy enforcement, and automated guardrails. Use when setting up code quality rules for Exa integrations, implementing pre-commit hooks, or configuring CI policy checks for Exa best practices. Trigger with phrases like "exa policy", "exa lint", "exa guardrails", "exa be...

1.8K 0
View
documenso-ci-integration logo
Dicklesworthstone/pi_agent_rust

documenso-ci-integration

Configure CI/CD pipelines for Documenso integrations. Use when setting up automated testing, deployment pipelines, or continuous integration for Documenso projects. Trigger with phrases like "documenso CI", "documenso GitHub Actions", "documenso pipeline", "documenso automated testing".

1.8K 0
View
openrouter-model-availability logo
Dicklesworthstone/pi_agent_rust

openrouter-model-availability

Build check model availability and implement fallback chains. Use when building resilient systems or handling model outages. Trigger with phrases like 'openrouter availability', 'openrouter fallback', 'openrouter model down', 'openrouter health check'.

1.8K 0
View
langfuse-enterprise-rbac logo
Dicklesworthstone/pi_agent_rust

langfuse-enterprise-rbac

Configure Langfuse enterprise organization management and access control. Use when implementing team access controls, configuring organization settings, or setting up role-based permissions for Langfuse projects. Trigger with phrases like "langfuse RBAC", "langfuse teams", "langfuse organization"...

1.8K 0
View
cursor-compliance-audit logo
Dicklesworthstone/pi_agent_rust

cursor-compliance-audit

Execute compliance and security auditing for Cursor usage. Triggers on "cursor compliance", "cursor audit", "cursor security review", "cursor soc2", "cursor gdpr". Use when analyzing or auditing cursor compliance audit. Trigger with phrases like "cursor compliance audit", "cursor audit", "cursor".

1.8K 0
View
apollo-ci-integration logo
Dicklesworthstone/pi_agent_rust

apollo-ci-integration

Configure Apollo.io CI/CD integration. Use when setting up automated testing, continuous integration, or deployment pipelines for Apollo integrations. Trigger with phrases like "apollo ci", "apollo github actions", "apollo pipeline", "apollo ci/cd", "apollo automated tests".

1.8K 0
View
python-script logo
Dicklesworthstone/pi_agent_rust

python-script

Create robust Python automation with full logging and safety checks. Use when tasks need complex data processing, authenticated API work, conditional file operations, or error handling beyond simple shell commands.

1.8K 0
View
posthog-multi-env-setup logo
Dicklesworthstone/pi_agent_rust

posthog-multi-env-setup

Configure PostHog across development, staging, and production environments. Use when setting up multi-environment deployments, configuring per-environment secrets, or implementing environment-specific PostHog configurations. Trigger with phrases like "posthog environments", "posthog staging", "po...

1.8K 0
View
ai-agents-architect logo
Dicklesworthstone/pi_agent_rust

ai-agents-architect

Expert in designing and building autonomous AI agents. Masters tool use, memory systems, planning strategies, and multi-agent orchestration. Use when: build agent, AI agent, autonomous agent, tool use, function calling.

1.8K 0
View
insecure-deserialization-checker logo
Dicklesworthstone/pi_agent_rust

insecure-deserialization-checker

Validate insecure deserialization checker operations. Auto-activating skill for Security Fundamentals. Triggers on: insecure deserialization checker, insecure deserialization checker Part of the Security Fundamentals skill category. Use when working with insecure deserialization checker functiona...

1.8K 0
View
path-traversal-finder logo
Dicklesworthstone/pi_agent_rust

path-traversal-finder

Manage path traversal finder operations. Auto-activating skill for Security Fundamentals. Triggers on: path traversal finder, path traversal finder Part of the Security Fundamentals skill category. Use when working with path traversal finder functionality. Trigger with phrases like "path traversa...

1.8K 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View