@sentinelqa/uploader 0.1.2 → 0.1.3

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.
Files changed (2) hide show
  1. package/dist/cli.js +32 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -218,10 +218,21 @@ const detectGitLabEnv = () => {
218
218
  provider: "gitlab",
219
219
  commit: {
220
220
  sha: readEnv("CI_COMMIT_SHA"),
221
- branch: readEnv("CI_COMMIT_BRANCH") || readEnv("CI_COMMIT_REF_NAME")
221
+ branch: readEnv("CI_COMMIT_BRANCH") || readEnv("CI_COMMIT_REF_NAME"),
222
+ message: readEnv("CI_COMMIT_MESSAGE"),
223
+ author: readEnv("GITLAB_USER_NAME") || readEnv("GITLAB_USER_LOGIN")
224
+ },
225
+ workflow: {
226
+ id: readEnv("CI_PIPELINE_ID"),
227
+ name: readEnv("CI_PIPELINE_SOURCE")
228
+ },
229
+ job: {
230
+ id: readEnv("CI_JOB_ID"),
231
+ name: readEnv("CI_JOB_NAME")
222
232
  },
223
233
  ci: {
224
- url: readEnv("CI_JOB_URL") || readEnv("CI_PIPELINE_URL")
234
+ url: readEnv("CI_JOB_URL") || readEnv("CI_PIPELINE_URL"),
235
+ pipelineUrl: readEnv("CI_PIPELINE_URL")
225
236
  }
226
237
  };
227
238
  };
@@ -238,8 +249,21 @@ const detectGitHubEnv = () => {
238
249
  const url = serverUrl && repo && runId ? `${serverUrl}/${repo}/actions/runs/${runId}` : null;
239
250
  return {
240
251
  provider: "github",
241
- commit: { sha, branch },
242
- ci: { url }
252
+ commit: {
253
+ sha,
254
+ branch,
255
+ message: readEnv("GITHUB_COMMIT_MESSAGE") || null,
256
+ author: readEnv("GITHUB_ACTOR")
257
+ },
258
+ workflow: {
259
+ id: runId,
260
+ name: readEnv("GITHUB_WORKFLOW")
261
+ },
262
+ job: {
263
+ id: readEnv("GITHUB_RUN_ATTEMPT"),
264
+ name: readEnv("GITHUB_JOB")
265
+ },
266
+ ci: { url, pipelineUrl: url }
243
267
  };
244
268
  };
245
269
  const getArtifacts = (rootDir, typeOverride, runId, s3Prefix) => {
@@ -348,6 +372,8 @@ const main = async () => {
348
372
  fail("Commit branch is required.");
349
373
  if (!ci.ci.url)
350
374
  fail("CI run URL is required.");
375
+ if (!ci.workflow.id)
376
+ fail("Workflow ID is required.");
351
377
  const appUrl = readEnv("SENTINEL_URL") || readEnv("APP_URL") || DEFAULT_APP_URL;
352
378
  const createRes = await withRetry(() => fetch(`${appUrl}/api/runs`, {
353
379
  method: "POST",
@@ -358,6 +384,8 @@ const main = async () => {
358
384
  body: JSON.stringify({
359
385
  provider: ci.provider,
360
386
  commit: ci.commit,
387
+ workflow: ci.workflow,
388
+ job: ci.job,
361
389
  ci: ci.ci
362
390
  })
363
391
  }), "POST /api/runs");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentinelqa/uploader",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "private": false,
5
5
  "description": "Sentinel uploader CLI for CI/CD debugging artifacts",
6
6
  "license": "MIT",