duoops 0.2.3 → 0.2.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.
@@ -11,6 +11,7 @@ import { fileURLToPath } from 'node:url';
11
11
  import { configManager } from '../lib/config.js';
12
12
  import { detectGcpProject, enableApis, validateProjectAccess } from '../lib/gcloud.js';
13
13
  import McpDeploy from './mcp/deploy.js';
14
+ const gitlabAuthHeaders = (token) => token.startsWith('glpat-') ? { 'PRIVATE-TOKEN': token } : { Authorization: `Bearer ${token}` };
14
15
  const hasBinary = (command) => {
15
16
  try {
16
17
  execSync(`${command} --version`, { stdio: 'ignore' });
@@ -50,7 +51,7 @@ const setGitlabVariable = async (auth, projectPath, variable) => {
50
51
  const apiUrl = `${base}/api/v4/projects/${project}/variables`;
51
52
  await axios
52
53
  .delete(`${apiUrl}/${variable.key}`, {
53
- headers: { 'PRIVATE-TOKEN': auth.token },
54
+ headers: gitlabAuthHeaders(auth.token),
54
55
  })
55
56
  .catch(() => { });
56
57
  await axios.post(apiUrl, {
@@ -58,7 +59,7 @@ const setGitlabVariable = async (auth, projectPath, variable) => {
58
59
  masked: Boolean(variable.masked),
59
60
  protected: false,
60
61
  value: variable.value,
61
- }, { headers: { 'PRIVATE-TOKEN': auth.token } });
62
+ }, { headers: gitlabAuthHeaders(auth.token) });
62
63
  };
63
64
  const ensureServiceAccount = (projectId, serviceAccount) => {
64
65
  try {
@@ -669,5 +669,5 @@
669
669
  ]
670
670
  }
671
671
  },
672
- "version": "0.2.3"
672
+ "version": "0.2.4"
673
673
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duoops",
3
3
  "description": "Toolset for Explainable and Sustainable CI on Gitlab.",
4
- "version": "0.2.3",
4
+ "version": "0.2.4",
5
5
  "author": "Younes Laaroussi",
6
6
  "bin": {
7
7
  "duoops": "./bin/run.js"