@pixeyedev/core 0.4.1 → 0.4.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/ci.js +9 -1
  2. package/package.json +1 -1
package/dist/ci.js CHANGED
@@ -9,8 +9,16 @@ const detectGitHubActions = () => {
9
9
  if (!commit || !branch || !runId) {
10
10
  return null;
11
11
  }
12
+ // PR number: explicit env > GITHUB_REF on pull_request events (refs/pull/123/merge)
12
13
  const prRaw = process.env.PIXEYE_PR;
13
- const prNumber = prRaw ? parseInt(prRaw, 10) : undefined;
14
+ let prNumber = prRaw ? parseInt(prRaw, 10) : undefined;
15
+ if (!prNumber) {
16
+ const ref = process.env.GITHUB_REF ?? '';
17
+ const prMatch = ref.match(/^refs\/pull\/(\d+)\//);
18
+ if (prMatch) {
19
+ prNumber = parseInt(prMatch[1], 10);
20
+ }
21
+ }
14
22
  // PR target branch: GITHUB_BASE_REF is set on pull_request events
15
23
  const baseBranch = process.env.GITHUB_BASE_REF || undefined;
16
24
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixeyedev/core",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [