GitLab reference
Everything here is read from the generated files and the code. For the setup, see launchset on GitLab.
Parent pipeline, in .gitlab/launchset.yml:
| Job | Runs in | What it does |
|---|---|---|
launchset-check |
MR pipelines into the base, maintenance and prerelease branches (not a fork MR’s pipeline in the fork) | The changeset check and its sticky MR note. interruptible. |
launchset-release |
Pushes, and Run pipeline / API pipelines, of the base and maintenance branches | Updates the release MR, or plans the release. Writes plan.json, launchset.env, launchset.sh and launchset-child.yml. resource_group: launchset-release-$CI_COMMIT_REF_SLUG, not interruptible. |
launchset-build |
Same as launchset-release |
Trigger job. Runs the child pipeline with strategy: mirror. Passes PARENT_PIPELINE_ID. |
launchset-preview-plan |
MR pipelines (automatic with the label, else manual), preview and prerelease branch pushes, Run pipeline with LAUNCHSET_PREVIEW=true |
Plans a preview or prerelease. |
launchset-preview |
Same conditions | Trigger job for the preview child pipeline. Skipped while the plan job waits to be played. |
launchset-preview-sweep |
Only scheduled pipelines with LAUNCHSET_PREVIEW_SWEEP=true (a schedule you create) |
launchset preview-sweep: starts an MR pipeline for open MRs that just got the preview label. GIT_DEPTH: "1", interruptible. No other launchset job runs in that pipeline. |
Hidden templates: .launchset-cli (the node:24 image, GIT_DEPTH: "0", the install lines) and .launchset-release-rules. Jobs run in one stage (see the stage).
Child pipeline (launchset-child.yml):
| Job | What it does |
|---|---|
build-<target> |
A release build of one target: stamp, verify, your steps, mark. |
preview-<target> |
A preview build: stamp, your steps. |
launchset-finalize |
when: always. Creates the release tag and the GitLab release, or records a partial release. Release pipelines only. |
launchset-preview-comment |
when: always, after the preview-<target> jobs. The sticky MR note, or the prerelease GitLab release. Preview pipelines with a plan only. |
launchset-nothing-to-build |
The only job when there is nothing to build (a release MR update, none mode, a skipped preview). Prints why. |
.launchset_cli |
Hidden. The child’s own CLI template. |
Your hidden jobs in .gitlab/launchset-targets.yml are .launchset-<target>.
Pipeline variables (Run pipeline)
Section titled “Pipeline variables (Run pipeline)”Set on Build → Pipelines → Run pipeline or through the API. They need pipeline variables to be allowed.
| Variable | Where | Effect |
|---|---|---|
| none | Base or maintenance branch | Retries an unfinished release of the current version. |
LAUNCHSET_TARGET=<name> |
Base or maintenance branch | Ships a manual target. See Manual targets. |
LAUNCHSET_RELEASE_VERSION=<version> |
With LAUNCHSET_TARGET |
The released version to ship. Default: the latest release on the branch. |
LAUNCHSET_FORCE=true |
With LAUNCHSET_TARGET |
Ships even when the target already shipped a higher version. |
LAUNCHSET_ATTEMPT=<1-99> |
With LAUNCHSET_TARGET |
For a target with the semver build-number strategy: the last two digits of its build number (default 1), to upload the same version again. An error for other strategies. |
LAUNCHSET_PREVIEW=true |
Any branch | Builds a preview of the branch instead of releasing. |
LAUNCHSET_TARGET=<names> |
With LAUNCHSET_PREVIEW=true |
The targets to preview (comma-separated, or all). |
LAUNCHSET_PREVIEW_MANUAL=true is set by the manual preview job in MR pipelines. You don’t set it yourself.
Schedule variables
Section titled “Schedule variables”| Variable | Where | Effect |
|---|---|---|
LAUNCHSET_PREVIEW_SWEEP=true |
A pipeline schedule (Build → Pipeline schedules) on the default branch | Runs only launchset-preview-sweep. Your jobs without rules run there too unless you exclude them: see Keep your own jobs out of the schedule. |
The --ci files
Section titled “The --ci files”Every command that produces outputs takes --ci. It is on by default when GITLAB_CI=true; --no-ci turns it off. It writes, to the working directory:
| File | Variable to move it | Content |
|---|---|---|
plan.json |
LAUNCHSET_PLAN_FILE |
The plan. Pass it on with --plan @plan.json. |
launchset.env |
LAUNCHSET_DOTENV |
A dotenv report (artifacts:reports:dotenv): NAME=value, values with line breaks left out. |
launchset.sh |
LAUNCHSET_SHELL_ENV |
The same variables as export NAME='value', multi-line values included. . ./launchset.sh loads them. |
launchset.ps1 |
LAUNCHSET_POWERSHELL_ENV |
The same variables for PowerShell, $env:NAME = 'value' (UTF-8 with a byte order mark, for Windows PowerShell 5.1). . ./launchset.ps1 loads them. |
launchset-child.yml |
LAUNCHSET_CHILD_PIPELINE |
The child pipeline. Only release and preview-plan, always. |
Commands in one job merge into the same files. A command that only passes the plan on (stamp, verify, mark, finalize, preview-comment) leaves plan.json as it is. A file the job’s user can’t write in place, such as an artifact the runner unpacked as root in a job whose image runs as another user, is replaced (a new file renamed over it), as long as its folder is writable. The plan doesn’t go through the dotenv file, because GitLab limits it to 5 KB and 20 variables on self-managed (more on GitLab.com, by tier). launchset-release keeps launchset.env as a dotenv report for your own later jobs; release writes 14 variables and warns when the file is over those defaults. In the build jobs, where stamp, verify and mark add more, nothing uploads the file, so going over is only a debug message (LAUNCHSET_DEBUG=1).
launchset also works in a checkout its user can’t write, such as one the runner cloned as root in a job whose image runs as another user (cimg/android runs as circleci). When git can’t write .git, launchset copies its refs to a temporary folder that borrows the checkout’s objects and runs git there, so mark can fetch the tags and push its marker without changing .git. A build file stamp can’t write in place is replaced, as long as its folder is writable. When the plan builds another commit than the pipeline’s (a retry of an unfinished release), the build job checks that commit out first. If git checkout can’t write .git, the job keeps HEAD and the index in a temporary folder of its own, which uses the checkout’s objects, refs and config, and sets GIT_DIR and GIT_WORK_TREE to it for the rest of the job. The log says so. .git itself isn’t changed, so cat .git/HEAD still shows the pipeline’s commit; git rev-parse HEAD shows the commit being built. Only a git checkout that fails because it can’t write .git takes that path: any other failure (a local change it would overwrite, a post-checkout hook) stops the job with git’s own message. While GIT_DIR is set, every git command in the job uses this checkout, also one meant for another repository: a step that clones or runs git elsewhere (a git dependency of npm, pub or CocoaPods, fastlane match, Flutter’s own git calls in its SDK folder) needs unset GIT_DIR GIT_WORK_TREE first, for example (unset GIT_DIR GIT_WORK_TREE; bundle exec fastlane match …). The checkout before your before_script waits until git can read the checkout, so a before_script that trusts it (git config --global --add safe.directory "$CI_PROJECT_DIR") or installs git still runs first; script then checks out.
These files never count as uncommitted changes, also when they come from a parent job’s artifacts (finalize needs a clean working tree for the changelog backport). Other untracked files do: launchset’s jobs therefore set cache: [], and launchset-release sets dependencies: [] so no artifacts of earlier stages land in its checkout.
Naming rule. Every output except plan becomes LAUNCHSET_ plus its name in upper snake case: already-published is LAUNCHSET_ALREADY_PUBLISHED, release-sha is LAUNCHSET_RELEASE_SHA, dist-tag is LAUNCHSET_DIST_TAG, docker-tags is LAUNCHSET_DOCKER_TAGS. The exported variables of stamp and ship (LAUNCHSET_VERSION, LAUNCHSET_BUILD_NUMBER, LAUNCHSET_CHANNEL) are added as they are and win on a clash. The outputs per command are in the Action reference (same names); launchset <command> --help lists the main ones.
See also CLI reference.
Variables launchset reads
Section titled “Variables launchset reads”| Variable | Used for |
|---|---|
LAUNCHSET_TOKEN |
The access token. The first choice. See Token and permissions. |
GITLAB_TOKEN |
The token when LAUNCHSET_TOKEN is not set. |
CI_JOB_TOKEN |
Reads only (merge requests, notes, releases). Never used for pushes. |
LAUNCHSET_CLI |
What jobs install with npm. Default launchset@<version that wrote the files>. |
LAUNCHSET_HOST |
github or gitlab. Overrides detection. |
LAUNCHSET_TARGET, LAUNCHSET_RELEASE_VERSION, LAUNCHSET_FORCE |
The inputs of a manual run (above). |
LAUNCHSET_PREVIEW, LAUNCHSET_PREVIEW_MANUAL |
Preview runs (above). |
LAUNCHSET_PREVIEW_SWEEP |
The preview sweep schedule (above). Read by the job’s rules only. |
LAUNCHSET_PLAN |
The plan JSON, for --plan. |
LAUNCHSET_DEBUG |
1 prints stack traces. |
CI_* |
Predefined variables: CI_PIPELINE_SOURCE, CI_COMMIT_BRANCH, CI_COMMIT_SHA, CI_COMMIT_TAG, CI_PROJECT_PATH, CI_SERVER_URL, CI_API_V4_URL, CI_PIPELINE_ID, CI_PIPELINE_IID, CI_JOB_NAME, CI_MERGE_REQUEST_*. |
Host detection: LAUNCHSET_HOST, else GITLAB_CI=true means GitLab, else GITHUB_ACTIONS=true means GitHub, else the host of the origin remote (a name with gitlab in it means GitLab), else GitHub. An invalid LAUNCHSET_HOST is an error.
Pipeline events: merge_request_event is a check or preview of an MR (also the MR pipelines the preview sweep starts); push is a branch push; web, api (and trigger, pipeline, chat) count as a manual run with the inputs above; parent_pipeline is a child pipeline and takes the MR of its parent; schedule runs only the preview sweep.
The preview-sweep command
Section titled “The preview-sweep command”launchset preview-sweep [--dry-run] [--max <n>] is GitLab only. It lists the open MRs with preview.label, finds when the label was last added to each (its label events), and starts an MR pipeline unless one of the MR’s pipelines for its head commit was created at or after that time. At most --max (10) per run, oldest label first; fork MRs and the release MR are skipped. It reports every MR (--json: mergeRequests[] with outcome created, would-create, skipped or failed) and exits 1 when a pipeline couldn’t be started. It needs LAUNCHSET_TOKEN and refuses when preview.rebuildOnPush is false. API calls: GET /projects/:id/merge_requests?state=opened&labels=…, GET …/merge_requests/:iid/resource_label_events, GET …/merge_requests/:iid/pipelines, GET …/merge_requests/:iid (the head pipeline, only after a merged results pipeline) and POST …/merge_requests/:iid/pipelines. See the CLI reference.
Differences from GitHub
Section titled “Differences from GitHub”| GitHub | GitLab | |
|---|---|---|
| How CI runs launchset | The action demonsters/launchset-action |
launchset <command> in a node:24 job. There is no GitLab equivalent of the Action. |
| Dynamic pipeline | if: on a job’s outputs |
A generated child pipeline |
| Where build steps go | The build job in launchset-release.yml |
.launchset-<target> jobs in .gitlab/launchset-targets.yml |
| Token | A GitHub App | An access token in LAUNCHSET_TOKEN |
| MR words | PR, #N |
MR, !N, links to /-/merge_requests/N |
| Run link | /actions/runs/N |
/-/pipelines/N |
| Preview by label | Starts when the label is added | Automatic on every pipeline of a labeled MR; otherwise a manual job. No label events: the optional preview sweep schedule starts a pipeline a few minutes after the label is added. |
| Markdown alerts in notes | > [!NOTE] |
> [!note] (lowercase, what GitLab documents; rendered since 17.10) |
| Releases | A pre-release flag, make_latest |
No prerelease flag, no “latest” flag. “Latest” is the release with the newest released_at. A hotfix release of a lower version therefore becomes the “latest” one. |
semver build numbers |
Use the run attempt | Always attempt 1: GitLab has no attempt counter. A retried plan job computes the same number, which is what a retry should upload. |
| Concurrency | concurrency groups, one waiting run |
resource_group, which keeps every waiting job. The order isn’t guaranteed; the release flow handles that. |
| Run number | GITHUB_RUN_NUMBER |
CI_PIPELINE_IID |
Target order (after) |
Not supported: one matrix job builds every target, so after is a config error |
needs on the other targets’ jobs, with their artifacts |
| Tag pushes | Start the workflows that listen to tags | Pushed with -o ci.skip: no tag pipelines (gitlab.tagPipelines: true lets release and prerelease tags start one) |
| Shells | Bash on every runner | sh, or PowerShell per target (gitlab.shell) |
| Fork PRs | No secrets: no preview | No project variables: no preview, and no check in the fork’s own pipeline (run the MR’s pipeline in your project to check it) |
Bot PRs (check.bots) |
dependabot[bot], renovate[bot] |
renovate-bot is also a default. Self-managed instances name their bots themselves: add yours to check.bots. |
| Jobs summary | The job summary | The job log |
| Repository path | owner/repo |
group/subgroup/project (nested groups) |
launchset finalize creates superseded partial releases before the version’s own release on GitLab, so the real release is created last and is the “latest”.
Known limitations
Section titled “Known limitations”GitLab support is written from GitLab’s documentation and tested against recorded API responses. These points have not been verified on a real GitLab instance yet. Report anything that behaves differently.
include: localwithextendsand!reference [.launchset-<target>, script]inside an artifact-generated child pipeline (and!reference [.launchset-<target>, before_script]in the build jobs of a retry). The documentation says includes merge before!reference.- Whether the dotenv variables of
launchset-releasereach child jobs throughneeds: pipeline:. It doesn’t matter for launchset, which loadslaunchset.shafterstamp. - The trigger job
launchset-preview, skipped while the manual plan job waits, should start once someone plays the plan job (GitLab resets the skipped jobs after it). - Whether retrying a failed job of a finished child pipeline also runs its
when: alwaysjob again (launchset-preview-comment,launchset-finalize). If it doesn’t, retry that job too. GET /userwith a project access token should return the bot user, which sets the commit identity.$CI_PIPELINE_IDas a variable of a trigger job (GitLab’s own example uses it, but the variables table marks it job-only).- The Docker, Android and macOS templates:
docker:29withdocker:29-dindandapk add nodejs-current,cimg/androidas a non-root user with an npm prefix, and Node on hosted macOS runners. - With
strategy: mirror, how a failed child job shows in the MR widget. - PowerShell build jobs on a real Windows runner. The generated lines were run with PowerShell 7 (as a script file and on stdin, like the runner does), with the runner’s per-line error check: a failing command ends the job with its exit code, and the already-published branch ends it with
mark’s. Windows PowerShell 5.1 and npm’s.ps1/.cmdshims on Windows weren’t tried. git push -o ci.skipfor tags. GitLab documents it; launchset retries the push without it (with a warning) when a remote doesn’t take push options.
Also remember: GitLab 18.2 or newer is the minimum, there is no CI/CD component (jobs install the npm package), and no static pipeline mode (the generated child pipeline is the only shape, so a policy that forbids child pipelines can’t use launchset yet).