justjavac/moonbit-ci — explained in plain English
Analysis updated 2026-08-07 · repo last pushed 2026-07-24
Print richer build logs that include the CI service name, branch, and commit hash.
Conditionally enable or disable build steps depending on whether the code runs in CI or locally.
Tag build artifacts with the originating git branch and commit for traceability.
Simulate GitLab or Bitbucket CI conditions in unit tests using a custom environment map.
Requires the MoonBit toolchain and native backend support since the library relies on local git process access and cannot target web assembly.
justjavac/ci is a MoonBit library that tells a program whether it's currently running inside a continuous integration (CI) service, and if so, which one. This is useful for build scripts or developer tools that need to behave differently when they run on a server like GitHub Actions versus a developer's laptop. The library exposes a few functions. The main one inspects the runtime environment and returns a record with details like the service name, repository slug, git branch, commit hash, and build identifiers. It recognizes about twenty common CI providers, including GitLab, Jenkins, and CircleCI. If it cannot identify a known provider, it falls back to running local git commands to gather the commit and branch, and checks a generic environment variable to guess whether CI is active. A second function lets you pass in a custom environment map, which is handy for testing without actually being on a CI server. Someone building developer tooling in MoonBit would use this to, for example, print richer build logs, conditionally enable steps that should only run in CI, or tag artifacts with the originating branch and commit. A test harness could use the environment-map variant to simulate GitLab or Bitbucket conditions and verify the detection logic without spinning up real pipelines. One notable design choice is that the package only supports the native backend, meaning it compiles to machine code rather than a managed runtime. The README explains this is because the full detection path may call local git commands asynchronously, which requires native process access. The tradeoff is that you cannot use this library from a web assembly target, but the benefit is reliable access to the local git repository when needed.
A MoonBit library that detects whether your code is running inside a continuous integration service like GitHub Actions or GitLab, and identifies which one. Useful for build scripts that need to behave differently on a server versus a developer's laptop.
Mainly MoonBit. The stack also includes MoonBit, Native backend, Git CLI.
Active — commit in last 30 days (last push 2026-07-24).
No license information is provided in the repository explanation, so usage rights are unknown.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.