@slates-integrations/github 0.2.0-rc.9 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -100,6 +100,87 @@ Search across GitHub for repositories, code, issues/pull requests, or users usin
100
100
 
101
101
  Update settings of an existing GitHub repository. Modify name, description, visibility, feature toggles (issues, wiki, projects), default branch, and archive status.
102
102
 
103
+ ## Repository events
104
+
105
+ Enable callbacks on a connection to set up repository events automatically, including
106
+ connections created through a portal. There are no repository settings to fill in.
107
+ Discovery pages through repositories visible to the connection and checks webhook
108
+ access for each one. Personal and organization repositories are supported on
109
+ GitHub.com and the GitHub Enterprise instance selected during authentication.
110
+ Connections in the same tenant share a repository webhook.
111
+
112
+ The account must be able to manage repository webhooks (repository admin or a
113
+ custom role granting webhook management). OAuth and classic personal access tokens
114
+ need `admin:repo_hook` (or a scope granting equivalent access, such as `repo`) plus
115
+ repository access. Fine-grained tokens need **Webhooks: read and write**. Organization
116
+ policies, SSO authorization, and the token's repository selection still apply.
117
+ No OAuth scopes are added automatically.
118
+
119
+ Discovery is bounded so it stays well inside GitHub's API rate limits: each scan
120
+ reads up to 1,000 repositories (10 pages of 100, ordered by full name). Repositories
121
+ where the account is an admin are eligible without extra requests; archived
122
+ repositories are skipped. Repositories where the account is not an admin are checked
123
+ for webhook access (custom roles), at most 50 per scan; further non-admin repositories
124
+ are skipped and a warning is logged. Repositories that deny webhook access are skipped.
125
+ Rate limits (detected from GitHub's rate-limit headers), invalid credentials, and
126
+ service failures are surfaced. The read-only access check cannot distinguish a
127
+ fine-grained token with only webhook read permission from one with write permission;
128
+ GitHub validates write access during hook creation and any failure is reported.
129
+
130
+ The callback runtime rescans active connections every 15 minutes for repositories
131
+ created or authorized later. Removing the last callback using a repository removes
132
+ its hook with connection credentials; failed cleanup remains retryable.
133
+
134
+ ### Supported events
135
+
136
+ | Area | Event names |
137
+ | --- | --- |
138
+ | Code and repositories | `push`, `create`, `delete`, `repository`, `fork`, `star` |
139
+ | Issues and collaboration | `issues`, `issue_comment`, `pull_request`, `pull_request_review`, `pull_request_review_comment`, `pull_request_review_thread`, `discussion`, `discussion_comment` |
140
+ | CI and checks | `workflow_run`, `workflow_job`, `check_run`, `check_suite`, `status` |
141
+ | Delivery | `release`, `deployment`, `deployment_status` |
142
+ | Security | `dependabot_alert` |
143
+
144
+ Each event has a separate trigger. Repository hooks receive `created` and
145
+ `completed` check-run actions and only `completed` check-suite actions. A merged
146
+ pull request has action `closed` and `payload.pull_request.merged: true`.
147
+ `issue_comment` includes conversation comments on both issues and pull requests;
148
+ `pull_request_review_comment` covers comments on a diff. Branch and tag deletions
149
+ can have no head commit. Discussions and Dependabot events require those features
150
+ to be available and enabled. Older Enterprise versions may not support every
151
+ event; unsupported registration is reported rather than reducing coverage.
152
+
153
+ ### Event output
154
+
155
+ Every callback contains `deliveryId`, `event`, `action` (or `null` when absent),
156
+ and the complete GitHub `payload`, including additional and nested provider
157
+ fields. For example, an issue update has this shape (payload abbreviated):
158
+
159
+ ```json
160
+ {
161
+ "deliveryId": "72d3162e-cc78-11e3-81ab-4c9367dc0958",
162
+ "event": "issues",
163
+ "action": "edited",
164
+ "payload": {
165
+ "action": "edited",
166
+ "repository": { "id": 42, "full_name": "octocat/hello-world" },
167
+ "issue": { "id": 101, "number": 1, "title": "Updated title" },
168
+ "changes": { "title": { "from": "Original title" } }
169
+ }
170
+ }
171
+ ```
172
+
173
+ The callback ID is the delivery ID. Its type is the event name plus action
174
+ (`issues.edited`), or just the event name (`push`). SHA-256 signatures and saved
175
+ repository/hook identities (hook ID and installation-target headers, repository ID
176
+ in the payload) are checked before events are accepted. Rejected or ignored
177
+ deliveries are logged with a reason code and delivery headers only, never the
178
+ payload or secret. Valid pings are acknowledged without callbacks. Redeliveries
179
+ retain their delivery IDs.
180
+
181
+ See [GitHub's event reference](https://docs.github.com/en/webhooks/webhook-events-and-payloads)
182
+ for provider payloads and event availability.
183
+
103
184
  ## License
104
185
 
105
186
  This integration is licensed under the [FSL-1.1](https://github.com/metorial/metorial-platform/blob/dev/LICENSE).