dependency-change-report 1.4.3 → 1.4.4

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.
@@ -33,6 +33,20 @@ export const detectVersions = async (repoPath = '.') => {
33
33
  }
34
34
  }
35
35
 
36
+ // Handle GitHub Actions pull request references
37
+ if (process.env.GITHUB_ACTIONS === 'true') {
38
+ // For pull requests, use the actual HEAD commit instead of GitHub's merge reference
39
+ if (currentRef && (currentRef.includes('/merge') || currentRef.includes('/head'))) {
40
+ try {
41
+ const commitHash = await executeCommand('git', ['rev-parse', 'HEAD'], repoPath, 10000, 'getting PR commit hash');
42
+ currentRef = commitHash.trim().substring(0, 7); // Use short hash
43
+ console.log(`Converted GitHub Actions reference to commit hash: ${currentRef}`);
44
+ } catch (error) {
45
+ console.warn(`Warning: Could not get commit hash for PR: ${error.message}`);
46
+ }
47
+ }
48
+ }
49
+
36
50
  // Get all tags sorted by version (descending)
37
51
  const allTagsOutput = await executeCommand('git', ['tag', '-l', '--sort=-version:refname'], repoPath, 30000, 'getting git tags');
38
52
  const allTags = allTagsOutput.trim().split('\n').filter(tag => tag.length > 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dependency-change-report",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "type": "module",
5
5
  "description": "Generate dependency change reports between git references",
6
6
  "main": "lib/index.mjs",