Skip to content

Commit ef8b033

Browse files
authored
feat: forward CI identity to the CLI for DB-driven notices (#37)
Set DCD_CI_PROVIDER=github and DCD_CI_WRAPPER_VERSION before invoking the dcd CLI so notices can target this GitHub Action (e.g. by version). Rebuilt dist.
1 parent b53bff1 commit ef8b033

2 files changed

Lines changed: 36 additions & 6 deletions

File tree

dist/index.js

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,7 +2216,7 @@ const Context = __importStar(__nccwpck_require__(8663));
22162216
const Utils = __importStar(__nccwpck_require__(1365));
22172217
// octokit + plugins
22182218
const core_1 = __nccwpck_require__(6895);
2219-
const plugin_rest_endpoint_methods_1 = __nccwpck_require__(9289);
2219+
const plugin_rest_endpoint_methods_1 = __nccwpck_require__(6495);
22202220
const plugin_paginate_rest_1 = __nccwpck_require__(6212);
22212221
exports.context = new Context.Context();
22222222
const baseUrl = Utils.getApiBaseUrl();
@@ -40711,6 +40711,16 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
4071140711
paramsString += ` --metadata ${escapeShellValue(pair)}`;
4071240712
});
4071340713
}
40714+
// Forward CI identity so DCD notices can target this GitHub Action (e.g.
40715+
// "GitHub Action < X"). The CLI reads these env vars; the spawned child
40716+
// inherits process.env. Provider alone still enables CI-surface notices.
40717+
process.env.DCD_CI_PROVIDER = 'github';
40718+
try {
40719+
process.env.DCD_CI_WRAPPER_VERSION = (__nccwpck_require__(8330)/* .version */ .rE);
40720+
}
40721+
catch (_b) {
40722+
// best-effort — version is optional
40723+
}
4071440724
// Execute the test command and capture the upload ID
4071540725
let uploadId = null;
4071640726
let testOutput = '';
@@ -43153,7 +43163,7 @@ paginateRest.VERSION = VERSION;
4315343163

4315443164
/***/ }),
4315543165

43156-
/***/ 9289:
43166+
/***/ 6495:
4315743167
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
4315843168

4315943169
"use strict";
@@ -43166,12 +43176,12 @@ __nccwpck_require__.d(__webpack_exports__, {
4316643176
restEndpointMethods: () => (/* binding */ restEndpointMethods)
4316743177
});
4316843178

43169-
;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js
43179+
;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoi_88f1cfdccbcd12f9bd89a662a3d08bce/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js
4317043180
const VERSION = "17.0.0";
4317143181

4317243182
//# sourceMappingURL=version.js.map
4317343183

43174-
;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js
43184+
;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoi_88f1cfdccbcd12f9bd89a662a3d08bce/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js
4317543185
const Endpoints = {
4317643186
actions: {
4317743187
addCustomLabelsToSelfHostedRunnerForOrg: [
@@ -45465,7 +45475,7 @@ var endpoints_default = Endpoints;
4546545475

4546645476
//# sourceMappingURL=endpoints.js.map
4546745477

45468-
;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js
45478+
;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoi_88f1cfdccbcd12f9bd89a662a3d08bce/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js
4546945479

4547045480
const endpointMethodsMap = /* @__PURE__ */ new Map();
4547145481
for (const [scope, endpoints] of Object.entries(endpoints_default)) {
@@ -45591,7 +45601,7 @@ function decorate(octokit, scope, methodName, defaults, decorations) {
4559145601

4559245602
//# sourceMappingURL=endpoints-to-methods.js.map
4559345603

45594-
;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js
45604+
;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoi_88f1cfdccbcd12f9bd89a662a3d08bce/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js
4559545605

4559645606

4559745607
function restEndpointMethods(octokit) {
@@ -45613,6 +45623,14 @@ legacyRestEndpointMethods.VERSION = VERSION;
4561345623
//# sourceMappingURL=index.js.map
4561445624

4561545625

45626+
/***/ }),
45627+
45628+
/***/ 8330:
45629+
/***/ ((module) => {
45630+
45631+
"use strict";
45632+
module.exports = {"rE":"2.1.2"};
45633+
4561645634
/***/ })
4561745635

4561845636
/******/ });

src/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,18 @@ const run = async (): Promise<void> => {
228228
});
229229
}
230230

231+
// Forward CI identity so DCD notices can target this GitHub Action (e.g.
232+
// "GitHub Action < X"). The CLI reads these env vars; the spawned child
233+
// inherits process.env. Provider alone still enables CI-surface notices.
234+
process.env.DCD_CI_PROVIDER = 'github';
235+
try {
236+
process.env.DCD_CI_WRAPPER_VERSION = (
237+
require('../package.json') as { version?: string }
238+
).version;
239+
} catch {
240+
// best-effort — version is optional
241+
}
242+
231243
// Execute the test command and capture the upload ID
232244
let uploadId: string | null = null;
233245
let testOutput = '';

0 commit comments

Comments
 (0)