dependency-change-report 1.3.0 → 1.3.2

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/cli.mjs +29 -1
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -23,7 +23,7 @@ const compare = command(
23
23
  arg('[newer]', 'the newer tag, commit, or branch'),
24
24
  async () => {
25
25
  try {
26
- const repoUrl = compare.args.repo;
26
+ let repoUrl = compare.args.repo;
27
27
  const olderVersion = compare.args.older;
28
28
  const newerVersion = compare.args.newer;
29
29
 
@@ -37,6 +37,20 @@ const compare = command(
37
37
  // Detect if running in GitHub Actions
38
38
  const isGitHubActions = process.env.GITHUB_ACTIONS === 'true';
39
39
 
40
+ // Add GitHub token authentication for private repositories
41
+ if (isGitHubActions && repoUrl.includes('github.com')) {
42
+ const token = process.env.GITHUB_TOKEN;
43
+ if (token) {
44
+ console.log(`Original repo URL: ${repoUrl}`);
45
+ // Convert https://github.com/owner/repo to https://token@github.com/owner/repo
46
+ repoUrl = repoUrl.replace('https://github.com/', `https://${token}@github.com/`);
47
+ console.log('Modified repo URL to use GitHub token authentication');
48
+ console.log('Using GitHub token for private repository access');
49
+ } else {
50
+ console.log('GitHub Actions detected but no GITHUB_TOKEN found');
51
+ }
52
+ }
53
+
40
54
  // Set up output directory
41
55
  let outputDir = compare.flags['output-dir'];
42
56
  if (!outputDir) {
@@ -188,6 +202,20 @@ const auto = command(
188
202
  // Detect if running in GitHub Actions
189
203
  const isGitHubActions = process.env.GITHUB_ACTIONS === 'true';
190
204
 
205
+ // Add GitHub token authentication for private repositories
206
+ if (isGitHubActions && repoUrl.includes('github.com')) {
207
+ const token = process.env.GITHUB_TOKEN;
208
+ if (token) {
209
+ console.log(`Original repo URL: ${repoUrl}`);
210
+ // Convert https://github.com/owner/repo to https://token@github.com/owner/repo
211
+ repoUrl = repoUrl.replace('https://github.com/', `https://${token}@github.com/`);
212
+ console.log('Modified repo URL to use GitHub token authentication');
213
+ console.log('Using GitHub token for private repository access');
214
+ } else {
215
+ console.log('GitHub Actions detected but no GITHUB_TOKEN found');
216
+ }
217
+ }
218
+
191
219
  // Set up output directory
192
220
  let outputDir = auto.flags['output-dir'];
193
221
  if (!outputDir) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dependency-change-report",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "type": "module",
5
5
  "description": "Generate dependency change reports between git references",
6
6
  "main": "lib/index.mjs",