-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
52 lines (46 loc) · 1.91 KB
/
.gitlab-ci.yml
File metadata and controls
52 lines (46 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# GitLab CI/CD configuration for OpenCode using the community component
# Translated from .github/workflows/opencode.yml
stages:
- review
# Note: Set OPENCODE_AUTH_JSON as a FILE type variable in GitLab settings.
# It should contain your auth.json content.
# Also ensure GITLAB_TOKEN and LIGHTBRIDGE variables are set.
include:
- component: gitlab.com/nagyv/gitlab-opencode/opencode@2
inputs:
job_prefix: auto-review
stage: review
auth_json: $OPENCODE_AUTH_JSON
- component: gitlab.com/nagyv/gitlab-opencode/opencode@2
inputs:
job_prefix: manual-review
stage: review
auth_json: $OPENCODE_AUTH_JSON
# Override the jobs generated by the component to match the original workflow logic
auto-review:run:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
script:
- echo "Running Auto PR Review..."
- opencode run --agent auto-review --model "lightbridge/gemini-3.1-flash-lite"
after_script:
- |
if [ "$CI_JOB_STATUS" == "failed" ] && [ -n "$CI_MERGE_REQUEST_IID" ] && [ -n "$GITLAB_TOKEN" ]; then
curl --request POST --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
--data-urlencode "body=🤖 Review failed. [View logs]($CI_JOB_URL)" \
"$CI_API_V4_URL/projects/$CI_PROJECT_ID/merge_requests/$CI_MERGE_REQUEST_IID/notes"
fi
manual-review:run:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: manual
script:
- echo "Running Manual PR Review..."
- opencode run --agent manual-review --model "lightbridge/glm-5"
after_script:
- |
if [ "$CI_JOB_STATUS" == "failed" ] && [ -n "$CI_MERGE_REQUEST_IID" ] && [ -n "$GITLAB_TOKEN" ]; then
curl --request POST --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
--data-urlencode "body=🤖 Manual review failed. [View logs]($CI_JOB_URL)" \
"$CI_API_V4_URL/projects/$CI_PROJECT_ID/merge_requests/$CI_MERGE_REQUEST_IID/notes"
fi