🦀 ClawHub
GitLab
by @ivangdavila
Avoid common GitLab CI/CD mistakes — rules gotchas, silent failures, and YAML merge traps.
TERMINAL
clawhub install gitlab📖 About This Skill
name: GitLab description: Avoid common GitLab CI/CD mistakes — rules gotchas, silent failures, and YAML merge traps. metadata: {"clawdbot":{"emoji":"🦊","os":["linux","darwin","win32"]}}
Rules Gotchas
rules: and only:/except: can't mix — use one or the other per jobwhen: defaults to on_success — rules: - if: $CI_COMMIT_TAG runs on tagrules: [] means never run — different from no rules at all- when: never at end to prevent fallthrough — otherwise unmatched conditions may runSilent Failures
docker:dind on non-privileged runner — fails with cryptic Docker errorsYAML Merge Traps
extends: doesn't deep merge arrays — scripts, variables arrays get replaced, not appended!reference [.job, script] to reuse — script: [!reference [.base, script], "my command"]include: files can override each other — last one wins for same keys&/* don't work across files — use extends: for cross-file reuseArtifacts vs Cache
dependencies: [] to skip if not neededneeds: downloads artifacts by default — needs: [{job: x, artifacts: false}] to skipDocker-in-Docker
DOCKER_HOST: tcp://docker:2375 required — job uses wrong Docker otherwiseDOCKER_TLS_CERTDIR: "" or configure TLS properly — half-configured TLS breaks buildsPipeline Triggers
CI_PIPELINE_SOURCE differs by trigger — push, merge_request_event, schedule, api, triggerrules: - if: $CI_MERGE_REQUEST_IID — not just branch rules