Интеграция Notion API в CI/CD для автоматизации документации.

Звёзды2 926
Авторjeremylongshore

Установка

SKILL.md

Notion CI Integration

Overview

Integrate the Notion API into CI/CD pipelines for automated documentation sync, deploy tracking, and configuration reads. GitHub Actions workflows push release notes to Notion pages, upsert deploy entries in databases, create incident pages, and read feature flags — all with rate-limit handling, and each concern in its own reference file for copy-ready code.

Prerequisites

  • GitHub repository with Actions enabled
  • Notion internal integration token (create at https://www.notion.so/my-integrations)
  • Target Notion pages/databases shared with the integration (click "..." > "Connections" > add the integration)
  • NOTION_TOKEN stored as a GitHub Actions secret
  • Node.js 18+ or Python 3.9+ in the CI environment

Authentication

Every request authenticates with an internal integration token passed as a bearer credential. The Notion SDKs read it from the NOTION_TOKEN environment variable (new Client({ auth: process.env.NOTION_TOKEN }) in Node, Client(auth=token) in Python). Store it as a repository secret and inject it per job — never hardcode it (gh secret set NOTION_TOKEN). A token only reaches pages and databases explicitly shared with the integration (page menu > "Connections" > add integration); an unshared target returns 404 Object not found, not 401 — see Error Handling.

Instructions

The integration is three composable pieces — read each summary for its shape, then open the linked reference for complete, copy-ready code.

Step 1: Workflow for documentation sync

Add a workflow that reacts to release: published and pushes to main. It runs three jobs — create a release-notes page, sync the CHANGELOG.md page, and update the deploy tracker — each injecting NOTION_TOKEN and the relevant database ID as env:

# .github/workflows/notion-docs-sync.yml
on:
  release: { types: [published] }
env:
  NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
jobs:
  sync-release-notes:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4      # + npm ci (see reference)
      - run: node scripts/notion-release-sync.js
        env:
          NOTION_RELEASES_DB: ${{ secrets.NOTION_RELEASES_DB }}
          RELEASE_TAG: ${{ github.event.release.tag_name }}

See full workflow YAML for all three jobs, the changelog push trigger, and the needs:-gated deploy-status job.

Step 2: CI scripts for Notion operations

Back the workflow with small scripts. The release-notes script creates a database page and appends the body as blocks in chunks of 100 (Notion's per-request limit) with a 350ms delay between batches:

// scripts/notion-release-sync.js — skeleton
const notion = new Client({ auth: process.env.NOTION_TOKEN });
const page = await notion.pages.create({
  parent: { database_id: process.env.NOTION_RELEASES_DB },
  properties: { Name: { title: [{ text: { content: `Release ${tag}` } }] } },
});
for (let i = 0; i < blocks.length; i += 100) {
  await notion.blocks.children.append({ block_id: page.id, children: blocks.slice(i, i + 100) });
  if (i + 100 < blocks.length) await sleep(350);   // stay under 3 req/sec
}

See CI scripts for the complete release-notes and deploy-status upsert scripts (Node.js) plus a Python batch updater with --dry-run and retry-after handling.

Step 3: Reading configuration from Notion in CI

Treat a Notion database as a feature-flag store that non-engineers can edit. Query it filtered by environment, extract Key/Value pairs, and write notion-config.json for downstream CI steps to read:

// scripts/notion-read-config.js — skeleton
const response = await notion.databases.query({
  database_id: process.env.NOTION_CONFIG_DB,
  filter: { property: 'Environment', select: { equals: process.env.DEPLOY_ENV } },
});
writeFileSync('notion-config.json', JSON.stringify(config, null, 2));

See config reads for the full extraction script and the GitHub Actions steps that load and consume the flags.

Output

  • GitHub Actions workflow that syncs release notes to a Notion database on every release
  • Deploy tracker that updates database entries with status "Deployed", version tag, commit SHA, and timestamp
  • Python batch update script for bulk status changes in CI (with --dry-run safety)
  • Config reader that pulls feature flags from Notion databases into the CI environment
  • Every script handles rate limits via sequential operations and 350ms delays between requests

Error Handling

IssueCauseSolution
401 UnauthorizedInvalid or expired NOTION_TOKENRegenerate token at notion.so/my-integrations, update gh secret set NOTION_TOKEN
404 Object not foundDatabase/page not shared with integrationOpen page in Notion > "..." > "Connections" > add integration
429 Rate limitedExceeded 3 requests/secondAdd time.sleep(0.34) between sequential calls; use retry-after header
400 Validation errorProperty name mismatch or wrong typeVerify property names exactly match database schema (case-sensitive)
Secret not found in CINOTION_TOKEN not configuredRun gh secret set NOTION_TOKEN and paste the integration token
Timeout in CILarge batch operationsSet timeout-minutes: 10 on the job; process in chunks of 100
ECONNRESET in CITransient network failureSDK has built-in retry (2 retries with exponential backoff by default)

Examples

Incident Report Creator (GitHub Actions)

Create structured incident pages from CI using workflow_dispatch. Dispatched manually or via gh workflow run with severity, title, and description inputs. Creates a Notion page with Description, Timeline, and Resolution sections.

See incident-workflow.md for the complete workflow YAML and database schema.

Quick trigger:

gh workflow run notion-incident.yml \
  -f severity=P1 \
  -f title="Database connection pool exhausted" \
  -f description="Production DB hit max connections at 14:32 UTC"

Changelog Page Updater

Parse CHANGELOG.md and replace a Notion page's content with structured blocks (headings, bullet lists, paragraphs). Clears existing content first, then appends in 100-block chunks with rate-limit delays.

See changelog-sync.md for the complete Node.js script and GitHub Actions step.

Resources

  • Notion API Reference
  • @notionhq/client on npm
  • notion-client on PyPI
  • GitHub Actions Encrypted Secrets
  • Notion Request Limits (3 req/sec)
  • GitHub Actions Workflow Syntax

Next Steps

For deployment patterns and environment-specific Notion sync, see notion-deploy-integration. For rate limit handling strategies at scale, see notion-rate-limits.

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: notion-ci-integration](https://darkplay.ru/ai/skills/jeremylongshore-claude-code-plugins-plus-skills-notion-ci-integration)

Похожие скиллы и другие разделы каталога

Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

plugin-devanthropics · Полный набор инструментов для разработки плагинов Claude Code. Включает 7 экспертных…
34 комп.
ruflo-metaharnessruvnet · Интеграция MetaHarness: доступ к score/genome/mint/mcp-scan/threat-model через навыки…
240 комп.
agentic-bundle-integration-apissickn33 · Установите набор редакционных навыков "Integration & APIs" для Claude Code.
49 917 ★
airtableanthropics · Airtable — слой базы данных и операций для ваших агентов в продукте, маркетинге…
100 комп.
amazon-location-serviceanthropics · Помогает разработчикам добавлять карты, поиск мест, геокодирование, маршрутизацию и…
100 комп.
apolloanthropics · Поиск клиентов, обогащение лидов, загрузка цепочек аутрича и аналитика продаж с Apollo.io…
100 комп.
asanaanthropics · Интеграция с Asana для управления проектами. Создание и управление задачами, поиск…
100 комп.
brightdata-pluginanthropics · Веб-скрапинг, поиск в Google, извлечение структурированных данных и интеграция…
100 комп.
circlebackanthropics · Интеграция с контекстом разговоров Circleback. Поиск и доступ к встречам, письмам…
100 комп.
crowdstrike-falcon-foundryanthropics · Навыки разработки CrowdStrike Falcon Foundry для создания приложений кибербезопасности на…
100 комп.

Лучшие ИИ-инструменты для автоматизации и ассистентов

Ассистенты и автоматизация

Подборка ИИ-ассистентов для автоматизации рутины и ускорения рабочих процессов. Сервисы, которые берут на себя переписку, анализ данных, ведение базы знаний и подготовку продаж, эк

Give Me Public
Есть бесплатный тариф
5.0
AITunnelAitunnel
По запросу
5.0
STIVAStiva
По запросу
5.0
Wikibot (Викибот)Wikibot
По запросу
4.9
mymeet.aiMymeet
По запросу
4.9
InsighterInsighter
По запросу
4.9
TGHuntTghunt
Есть бесплатный тариф
4.9
LegiscanLegiscan
По запросу
4.9
RouterAIRouterai
По запросу
4.9
Wikibot 1.0 (Викибот)Wikibot
По запросу
4.9

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8