@useairfoil/producer-github

中文文档
0.0.3发布于 2026/11/03TypeScriptES Module构建来源已验证

Syncs repositories, issues, pull requests, comments, reviews, commits, checks, Actions runs and jobs, and releases from one GitHub App installation. It backfills each resource, takes webhooks at POST /webhooks/github, and polls for changes every 15 minu

原始使用文档
文档目录7 节
  1. Config
  2. Setup
  3. API version
  4. Data
  5. Limits
  6. Demo data
  7. Local development

GitHub producer

Syncs repositories, issues, pull requests, comments, reviews, commits, checks, Actions runs and jobs, and releases from one GitHub App installation. It backfills each resource, takes webhooks at POST /webhooks/github, and polls for changes every 15 minutes.

ResourceWhat
repositoriesRepositories the installation can read
issuesIssues, without pull requests
pull_requestsPull requests
issue_commentsComments on issues and pull requests
pull_request_reviewsPull request reviews
pull_request_review_commentsComments on pull request diffs
pull_request_commitsCommits in each pull request
commitsCommits on the default branch
check_runsCheck runs, such as Actions jobs and other apps
commit_statusesCommit statuses from CI services
workflow_runsActions workflow runs
workflow_jobsJobs of workflow runs, with their steps
releasesReleases, with their assets

Config

VariableRequiredDefault
GITHUB_APP_CLIENT_IDyesnone
GITHUB_APP_PRIVATE_KEYyesnone
GITHUB_INSTALLATION_IDyesnone
GITHUB_WEBHOOK_SECRETyesnone

The private key can be on one line with \n for newlines.

Setup

Create a GitHub App under Developer settings → GitHub Apps:

  • Webhook URL <connector>/webhooks/github, with a random secret.
  • Repository permissions, read-only: Actions, Checks, Commit statuses, Contents, Issues, and Pull requests.
  • Events: Check run, Issue comment, Issues, Pull request, Pull request review, Pull request review comment, Push, Release, Repository, Status, Workflow job, and Workflow run.

Generate a private key, then install the app and pick the repositories to sync. The installation ID is the number at the end of the installation page URL.

One app has one webhook URL, so use one app per connector.

API version

The connector pins REST API version 2026-03-10 with the X-GitHub-Api-Version header.

Data

  • issues has no pull requests. issue_comments has comments on both.
  • Deleted repositories, issues, comments, and releases get _deleted. A transferred issue is deleted under its old ID.
  • commits and pull_request_commits keep author and committer names, not emails.
  • Reviews, check runs, and jobs have no update time in GitHub. Their version is when the connector read them.
  • A repository's issues, pull requests, and comments stay when it is deleted or leaves the installation.
  • Bodies are free text. Treat private repository data as confidential.

Limits

  • Deletes only come from webhooks. A missed delete stays, even after a new backfill. A restored repository comes back once GitHub reports it with a newer update time.
  • A row deleted during the backfill can make the next page skip one row.
  • commits is the default branch only. Polling uses the commit time, so an old commit pushed later only comes by webhook.
  • Check runs and statuses are polled once, soon after a default-branch commit, so a check that finishes later only updates by webhook. Webhooks bring them for every branch.
  • pull_request_commits has at most 250 commits per pull request. Commits removed by a force push stay.
  • A release asset's download_count is from the last time the release changed.
  • Workflow runs are polled for a day after they start. A later re-run comes by webhook. A run row is its latest attempt; jobs keep every attempt.
  • Reviews, pull request commits, check runs, statuses, and jobs cost one request per pull request, commit, or run, in backfill and for each change. A big repository with years of CI can take hours of rate limit to backfill.
  • Polling costs about 12 requests per repository every 15 minutes, plus the ones above. About 250 active repositories reach GitHub's limit.

Demo data

pnpm demo --size 128MiB writes made-up GitHub data without GitHub credentials. See the Connector Kit README for the flags and the variables it needs.

Each change has an issue, the pull request that fixes it, comments, a review, commits, CI runs with jobs and check runs, and, once merged, a commit on main with a deploy status. Some merges ship a release. The 6 repositories don't grow with the size.

Local development

cd connectors/producer-github
pnpm sandbox

Webhooks need a public URL that forwards to http://localhost:8080/webhooks/github.

To record VCR, put the test app's values in .env, delete test/__cassettes__/api.vcr.test.cassette, and run pnpm test:ci.

pnpm start runs the hosted connector. It needs the Wings and PostgreSQL variables from the Connector Kit README.

版本与发布记录

@useairfoil/producer-github 共发布 4 个版本,首次发布于 2026/10/29;过去 12 个月发布了 4 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.0.3latest2026/11/03今天
0.0.22026/10/295 天前
0.0.12026/10/295 天前
0.0.0-stage2026/10/295 天前

关于 @useairfoil/producer-github 的常见问题

@useairfoil/producer-github 是什么?

同步存储库、问题、拉取请求、评论、审查、提交、检查、操作运行和作业,并从一个GitHub应用程序安装发布。它回填每个资源,获取webhook POST /webhooks/github,每15分钟进行一次民意调查

如何安装 @useairfoil/producer-github?

在项目目录运行 npm install @useairfoil/producer-github,或使用 pnpm add / yarn add / bun add。

@useairfoil/producer-github 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@useairfoil/producer-github 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@useairfoil/producer-github 可以商用吗?

@useairfoil/producer-github 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@useairfoil/producer-github 还在维护吗?

最新版本 0.0.3 发布于 2026/11/03(今天);至今共发布 4 个版本,其中过去 12 个月发布了 4 个;首次发布于 2026/10/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。