@canyonjs/cli 1.0.29 → 1.0.31

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/index.js +11 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import node_fs from "node:fs";
4
4
  import node_path from "node:path";
5
5
  import axios from "axios";
6
6
  var package_namespaceObject = {
7
- rE: "1.0.29"
7
+ rE: "1.0.31"
8
8
  };
9
9
  function mergeNumberMaps(a = {}, b = {}) {
10
10
  const result = {
@@ -61,6 +61,14 @@ function mergeCoverageMaps(target = {}, source = {}) {
61
61
  }
62
62
  async function mapCommand(params, options) {
63
63
  console.log('Current working directory:', process.cwd());
64
+ const isGitHubActions = 'true' === process.env.GITHUB_ACTIONS || !!process.env.GITHUB_EVENT_PATH;
65
+ let githubEvent;
66
+ if (isGitHubActions && process.env.GITHUB_EVENT_PATH) try {
67
+ if (node_fs.existsSync(process.env.GITHUB_EVENT_PATH)) githubEvent = node_fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8');
68
+ else console.log('GITHUB_EVENT_PATH file not found:', process.env.GITHUB_EVENT_PATH);
69
+ } catch (error) {
70
+ console.warn('Failed to read GITHUB_EVENT_PATH:', error);
71
+ }
64
72
  const { dsn, repo_id: repoID, sha, provider, build_target, debug, instrument_cwd, filter, scene } = params;
65
73
  if (!node_fs.existsSync(node_path.resolve(process.cwd(), '.canyon_output'))) return void console.log('No .canyon_output directory found, skipping upload.');
66
74
  const files = node_fs.readdirSync(node_path.resolve(process.cwd(), '.canyon_output'));
@@ -105,7 +113,8 @@ async function mapCommand(params, options) {
105
113
  buildTarget: build_target || '',
106
114
  coverage: Object.keys(data),
107
115
  build: {
108
- buildProvider: env_buildProvider,
116
+ provider: isGitHubActions ? "github_actions" : env_buildProvider,
117
+ event: isGitHubActions ? githubEvent : void 0,
109
118
  buildID: env_buildID,
110
119
  branch: env_branch
111
120
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canyonjs/cli",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {