pkg-pr-new 0.0.6 → 0.0.7

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/environments.ts CHANGED
@@ -25,6 +25,8 @@ declare global {
25
25
  GITHUB_EVENT_PATH: string;
26
26
  // A unique number for each workflow run within a repository. This number does not change if you re-run the workflow run. For example, 1658821493.
27
27
  GITHUB_RUN_ID: string;
28
+ // The job_id of the current job. For example, greeting_job.
29
+ GITHUB_JOB: string;
28
30
  // A unique number for each attempt of a particular workflow run in a repository. This number begins at 1 for the workflow run's first attempt, and increments with each re-run. For example, 3.
29
31
  GITHUB_RUN_ATTEMPT: string;
30
32
  }
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { defineCommand, runMain, parseArgs } from "citty";
1
+ import { defineCommand, runMain } from "citty";
2
2
  import assert from "node:assert";
3
3
  import path from "path";
4
4
  import ezSpawn from "@jsdevtools/ez-spawn";
@@ -71,23 +71,24 @@ const main = defineCommand({
71
71
  );
72
72
  process.exit(1);
73
73
  }
74
- const octokit = new Octokit();
74
+
75
+ new Octokit(); // gh authentication
75
76
 
76
77
  const {
77
- GITHUB_SERVER_URL,
78
78
  GITHUB_REPOSITORY,
79
79
  GITHUB_RUN_ID,
80
80
  GITHUB_RUN_ATTEMPT,
81
81
  GITHUB_ACTOR_ID,
82
+ GITHUB_JOB
82
83
  } = process.env;
83
84
 
84
85
  const [owner, repo] = GITHUB_REPOSITORY.split("/");
85
86
 
86
- // Note: If you need to use a workflow run's URL from within a job, you can combine these variables: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
87
- const url = `${GITHUB_SERVER_URL}/${owner}/${repo}/actions/runs/${GITHUB_RUN_ID}`;
88
-
89
87
  const metadata = {
90
- url,
88
+ owner,
89
+ repo,
90
+ job: GITHUB_JOB,
91
+ runId: Number(GITHUB_RUN_ID),
91
92
  attempt: Number(GITHUB_RUN_ATTEMPT),
92
93
  actor: Number(GITHUB_ACTOR_ID),
93
94
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pkg-pr-new",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",