@zerodeploy/cli 0.1.7 → 0.1.8

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 +19 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -5394,11 +5394,12 @@ function createProgressBar(options) {
5394
5394
  // src/utils/ci.ts
5395
5395
  function detectCI() {
5396
5396
  if (process.env.GITHUB_ACTIONS === "true") {
5397
+ const commitSha = getGitHubCommitSha();
5397
5398
  return {
5398
5399
  name: "github-actions",
5399
5400
  prNumber: extractGitHubPRNumber(),
5400
5401
  prTitle: null,
5401
- commitSha: process.env.GITHUB_SHA || null,
5402
+ commitSha,
5402
5403
  branch: process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME || null,
5403
5404
  commitMessage: null
5404
5405
  };
@@ -5466,6 +5467,21 @@ function detectCI() {
5466
5467
  }
5467
5468
  return null;
5468
5469
  }
5470
+ function getGitHubCommitSha() {
5471
+ if (process.env.GITHUB_EVENT_NAME === "pull_request") {
5472
+ const eventPath = process.env.GITHUB_EVENT_PATH;
5473
+ if (eventPath) {
5474
+ try {
5475
+ const { readFileSync: readFileSync2 } = __require("node:fs");
5476
+ const event = JSON.parse(readFileSync2(eventPath, "utf-8"));
5477
+ if (event?.pull_request?.head?.sha) {
5478
+ return event.pull_request.head.sha;
5479
+ }
5480
+ } catch {}
5481
+ }
5482
+ }
5483
+ return process.env.GITHUB_SHA || null;
5484
+ }
5469
5485
  function extractGitHubPRNumber() {
5470
5486
  const ref = process.env.GITHUB_REF;
5471
5487
  if (process.env.GITHUB_EVENT_NAME === "pull_request" && ref) {
@@ -6877,7 +6893,7 @@ var accountCommand = new Command2("account").description("Manage your ZeroDeploy
6877
6893
  }));
6878
6894
 
6879
6895
  // src/lib/version.ts
6880
- var VERSION = "0.1.7";
6896
+ var VERSION = "0.1.8";
6881
6897
 
6882
6898
  // src/commands/inspect.ts
6883
6899
  function getCommandByPath(rootCommand, path3) {
@@ -7006,7 +7022,7 @@ function createInspectCommand(rootProgram) {
7006
7022
  }
7007
7023
 
7008
7024
  // src/lib/version.ts
7009
- var VERSION2 = "0.1.7";
7025
+ var VERSION2 = "0.1.8";
7010
7026
 
7011
7027
  // src/lib/update-check.ts
7012
7028
  import { existsSync as existsSync3, mkdirSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerodeploy/cli",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "zerodeploy": "dist/cli.js"