dependency-change-report 1.3.0 → 1.3.1

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 +20 -0
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -37,6 +37,16 @@ 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
+ // Convert https://github.com/owner/repo to https://token@github.com/owner/repo
45
+ repoUrl = repoUrl.replace('https://github.com/', `https://${token}@github.com/`);
46
+ console.log('Using GitHub token for private repository access');
47
+ }
48
+ }
49
+
40
50
  // Set up output directory
41
51
  let outputDir = compare.flags['output-dir'];
42
52
  if (!outputDir) {
@@ -188,6 +198,16 @@ const auto = command(
188
198
  // Detect if running in GitHub Actions
189
199
  const isGitHubActions = process.env.GITHUB_ACTIONS === 'true';
190
200
 
201
+ // Add GitHub token authentication for private repositories
202
+ if (isGitHubActions && repoUrl.includes('github.com')) {
203
+ const token = process.env.GITHUB_TOKEN;
204
+ if (token) {
205
+ // Convert https://github.com/owner/repo to https://token@github.com/owner/repo
206
+ repoUrl = repoUrl.replace('https://github.com/', `https://${token}@github.com/`);
207
+ console.log('Using GitHub token for private repository access');
208
+ }
209
+ }
210
+
191
211
  // Set up output directory
192
212
  let outputDir = auto.flags['output-dir'];
193
213
  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.1",
4
4
  "type": "module",
5
5
  "description": "Generate dependency change reports between git references",
6
6
  "main": "lib/index.mjs",