@ascenda-one/github-collector 0.1.27 → 0.1.33
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 +35 -8
- package/dist/cli.js +1573 -103
- package/dist/config.js +5 -2
- package/dist/config.js.map +1 -1
- package/examples/workflow.yml +21 -5
- package/package.json +2 -2
package/dist/config.js
CHANGED
|
@@ -8,11 +8,14 @@ export function loadConfigFromEnv() {
|
|
|
8
8
|
const toolInstallationId = normalizeToolInstallationId(toolInstallationIdRaw);
|
|
9
9
|
// The whole collector is first-person, so without knowing who "I" am there
|
|
10
10
|
// is nothing it may legitimately emit. Failing here is the point: defaulting
|
|
11
|
-
// to the payload's actor would silently start recording other people.
|
|
11
|
+
// to the payload's actor would silently start recording other people. The
|
|
12
|
+
// same goes for a workflow that sets this to `github.actor`, which nothing
|
|
13
|
+
// here can detect, so the examples type the login in once instead.
|
|
12
14
|
const viewerLogin = process.env.ASCENDA_FORGE_LOGIN?.trim();
|
|
13
15
|
if (!viewerLogin) {
|
|
14
16
|
throw new Error("Missing ASCENDA_FORGE_LOGIN — the collector only ever emits your own " +
|
|
15
|
-
"review activity, so it cannot run without knowing whose it is."
|
|
17
|
+
"review activity, so it cannot run without knowing whose it is. Set it " +
|
|
18
|
+
"to your own GitHub login, not ${{ github.actor }}.");
|
|
16
19
|
}
|
|
17
20
|
const tokenFilePath = process.env.ASCENDA_EVENT_WRITE_TOKEN_FILE
|
|
18
21
|
?? defaultTokenFilePath(toolInstallationId);
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEpG,MAAM,CAAC,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAUpD,MAAM,UAAU,iBAAiB;IAC/B,MAAM,UA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AAG,OAAO,CAAC,GAAG,CAAC,8BAA8B;WAC3D,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;IAE9C,MAAM,SAAS,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;IAC/C,MAAM,eAAe,GAAG,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC;IAC3E,IAAI,CAAC,eAAe;QAAE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IAC3F,IAAI,CAAC,SAAS;QAAE,sBAAsB,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IAEvE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC;AACzF,CAAC;AAED,SAAS,2BAA2B,CAAC,KAAa;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,iBAAiB,IAAI,OAAO,EAAE,CAAC;AAC7E,CAAC"}
|
package/examples/workflow.yml
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
# Collaboration signals — review load and pull-request activity — for one
|
|
2
2
|
# repository. Drop this at .github/workflows/ascenda-collaboration.yml.
|
|
3
3
|
#
|
|
4
|
-
#
|
|
4
|
+
# Each step belongs to one person. Three values come from pairing a collector
|
|
5
|
+
# identity on that person's machine:
|
|
5
6
|
# npx -y @ascenda-one/claude-code-hooks pair --tool-type github_collector
|
|
6
7
|
# which prints the installation id and the path of the token file to read.
|
|
8
|
+
# Store them as repository secrets with that person's suffix:
|
|
9
|
+
#
|
|
10
|
+
# ASCENDA_TOOL_INSTALLATION_ID_OCTOCAT the installation id
|
|
11
|
+
# ASCENDA_EVENT_WRITE_TOKEN_OCTOCAT the token file's contents
|
|
12
|
+
# ASCENDA_FORGE_LOGIN_OCTOCAT their GitHub login, typed once
|
|
13
|
+
#
|
|
14
|
+
# ASCENDA_FORGE_LOGIN is the paired person's own login. Never set it to
|
|
15
|
+
# ${{ github.actor }}: the actor is whoever triggered the run, so a
|
|
16
|
+
# colleague's pull request or review would be recorded under your
|
|
17
|
+
# installation, and a review request (whose actor is the requester) would
|
|
18
|
+
# never match you.
|
|
7
19
|
#
|
|
8
20
|
# This collector has its own tool type and rides workflow_telemetry, not
|
|
9
21
|
# ide_telemetry: how you work with your team is separately revocable from
|
|
@@ -22,8 +34,12 @@ jobs:
|
|
|
22
34
|
steps:
|
|
23
35
|
# Exits 0 on every path that is not a configuration error, including
|
|
24
36
|
# "nothing to emit" — a telemetry step must never turn a build red.
|
|
25
|
-
|
|
37
|
+
#
|
|
38
|
+
# One step per participant. Add a copy with another suffix for each
|
|
39
|
+
# colleague who pairs; each step emits only its own person's activity.
|
|
40
|
+
- name: ascenda (octocat)
|
|
41
|
+
run: npx @ascenda-one/github-collector
|
|
26
42
|
env:
|
|
27
|
-
ASCENDA_TOOL_INSTALLATION_ID: ${{ secrets.
|
|
28
|
-
ASCENDA_EVENT_WRITE_TOKEN: ${{ secrets.
|
|
29
|
-
ASCENDA_FORGE_LOGIN: ${{
|
|
43
|
+
ASCENDA_TOOL_INSTALLATION_ID: ${{ secrets.ASCENDA_TOOL_INSTALLATION_ID_OCTOCAT }}
|
|
44
|
+
ASCENDA_EVENT_WRITE_TOKEN: ${{ secrets.ASCENDA_EVENT_WRITE_TOKEN_OCTOCAT }}
|
|
45
|
+
ASCENDA_FORGE_LOGIN: ${{ secrets.ASCENDA_FORGE_LOGIN_OCTOCAT }}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"publishConfig": { "access": "public" },
|
|
3
3
|
"name": "@ascenda-one/github-collector",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.33",
|
|
5
5
|
"description": "Code-forge collaboration collector for Ascenda work telemetry — first-person review and pull-request signals.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "tsc -p ./ && npm run bundle",
|
|
18
18
|
"watch": "tsc -w -p ./",
|
|
19
|
-
"bundle": "esbuild src/cli.ts --bundle --platform=node --format=esm --banner:js=\"import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);\" --outfile=dist/cli.js",
|
|
19
|
+
"bundle": "node ../scripts/esbuild-collector.mjs src/cli.ts --bundle --platform=node --format=esm --banner:js=\"import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);\" --outfile=dist/cli.js",
|
|
20
20
|
"test": "node --test"
|
|
21
21
|
},
|
|
22
22
|
"license": "Apache-2.0",
|