Skip to content

docs: add a GitLab CI example to the README (closes #231) - #343

Open
dchaudhari7177 wants to merge 1 commit into
KryptosAI:mainfrom
dchaudhari7177:docs/gitlab-ci-example
Open

docs: add a GitLab CI example to the README (closes #231)#343
dchaudhari7177 wants to merge 1 commit into
KryptosAI:mainfrom
dchaudhari7177:docs/gitlab-ci-example

Conversation

@dchaudhari7177

Copy link
Copy Markdown

Closes #231. Part of #221.

The README showed only a GitHub Actions workflow. Adds a ### GitLab CI subsection with a ready-to-paste .gitlab-ci.yml, plus the setup-ci invocation that writes it for you.

The snippet is generated, not hand-written

The issue's fourth point was that the example must match what setup-ci generates. Rather than eyeball it, I executed gitlabCiYaml() from src/commands/init-ci.ts for the --command form and pasted its exact output — so the README and the generator cannot drift apart.

# .gitlab-ci.yml
mcp-observatory:
  image: node:22
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    - if: $CI_COMMIT_BRANCH == 'main'
  script:
    - npx @kryptosai/mcp-observatory test npx -y my-mcp-server --deep --security --sarif mcp-observatory.sarif
  artifacts:
    reports:
      sast: mcp-observatory.sarif

The description calls out that the SARIF is published as a GitLab sast report — that's what makes findings appear in the merge-request security widget rather than sitting in the job log, and it's the non-obvious part of the template.

Verified the embedded YAML parses (yaml.safe_load). Docs-only change.

🤖 Generated with Claude Code

The README showed only a GitHub Actions workflow. Adds a ready-to-paste
.gitlab-ci.yml under the CI section, plus the setup-ci invocation that writes
it.

The snippet is not hand-written: it is the exact output of gitlabCiYaml() in
src/commands/init-ci.ts for the --command form, so the README and
`setup-ci --ci-provider gitlab-ci` cannot drift apart. That was the issue's
fourth acceptance point.

Notes the SARIF is published as a GitLab `sast` report, which is what makes
findings show up in the merge request security widget rather than just sitting
in the job log.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dchaudhari7177
dchaudhari7177 force-pushed the docs/gitlab-ci-example branch from b0c7f57 to 6a75d07 Compare August 15, 2026 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GitLab CI usage example to README

2 participants