@sonar-autofix/cli 0.0.7 → 0.0.8

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/index.js +6 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -38,6 +38,8 @@ async function main() {
38
38
  console.log(' LLM_MODEL LLM model name');
39
39
  console.log(' LLM_API_KEY LLM API key');
40
40
  console.log(' GIT_BRANCH Branch name for autofix commits (default: sonar-autofix)');
41
+ console.log(' GITHUB_TOKEN GitHub token used to authenticate git push and gh CLI');
42
+ console.log(' GIT_USERNAME Git username for token auth (default: x-access-token)');
41
43
  console.log('');
42
44
  console.log('Environment variables override config file values.');
43
45
  return;
@@ -82,9 +84,11 @@ async function main() {
82
84
  if (process.env.LLM_API_KEY) config.llm.apiKey = process.env.LLM_API_KEY;
83
85
  }
84
86
 
85
- if (process.env.GIT_BRANCH) {
87
+ if (process.env.GIT_BRANCH || process.env.GITHUB_TOKEN || process.env.GIT_USERNAME) {
86
88
  config.git = config.git || {};
87
- config.git.branch = process.env.GIT_BRANCH;
89
+ if (process.env.GIT_BRANCH) config.git.branch = process.env.GIT_BRANCH;
90
+ if (process.env.GITHUB_TOKEN) config.git.token = process.env.GITHUB_TOKEN;
91
+ if (process.env.GIT_USERNAME) config.git.username = process.env.GIT_USERNAME;
88
92
  }
89
93
 
90
94
  // Apply dry-run
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonar-autofix/cli",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "CLI tool for the Sonar Autofix tool",
5
5
  "main": "index.js",
6
6
  "bin": {