Skip to content

Commit 11a3900

Browse files
joostboonclaude
andcommitted
fix: use CI_JOB_TOKEN for GitLab MR comments to match docs
The docs promise no extra token setup — only ANTHROPIC_API_KEY and ELEMENTARY_API_KEY. Revert to CI_JOB_TOKEN which is automatic. Requires the project setting "Allow CI/CD job tokens to access API". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3cbd3d8 commit 11a3900

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/review.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function api(method, reqUrl, data) {
138138
if (existingId) {
139139
const updateUrl = updateTpl.replace("{id}", String(existingId));
140140
// GitHub uses PATCH, GitLab uses PUT
141-
const method = authName === "PRIVATE-TOKEN" ? "PUT" : "PATCH";
141+
const method = authName === "JOB-TOKEN" ? "PUT" : "PATCH";
142142
await api(method, updateUrl, { body });
143143
console.log(`Updated existing comment (id: ${existingId})`);
144144
} else {

templates/mr-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ elementary-mr-review:
4141
export POST_COMMENT_URL="${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/merge_requests/${CI_MERGE_REQUEST_IID}/notes"
4242
export LIST_COMMENTS_URL="${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/merge_requests/${CI_MERGE_REQUEST_IID}/notes"
4343
export UPDATE_COMMENT_URL_TPL="${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/merge_requests/${CI_MERGE_REQUEST_IID}/notes/{id}"
44-
export AUTH_HEADER_NAME="PRIVATE-TOKEN"
45-
export AUTH_HEADER_VALUE="${GITLAB_API_TOKEN}"
44+
export AUTH_HEADER_NAME="JOB-TOKEN"
45+
export AUTH_HEADER_VALUE="${CI_JOB_TOKEN}"
4646
export CLAUDE_MODEL="${ELEMENTARY_CI_CLAUDE_MODEL:-claude-haiku-4-5}"
4747
4848
SCRIPT_TAG="${ELEMENTARY_CI_SCRIPT_TAG:-v1}"

0 commit comments

Comments
 (0)