Sync Config
Keep Lunar Hub's copy of your config repo current on every push — with the sync-config GitHub Action, or a GitLab CI job.
Lunar Hub keeps its own copy of your configuration (the manifest plus your snippets), and it needs refreshing whenever your config repository changes. Both options below wrap the same command, lunar hub pull, so the CLI reference is the source of truth for the flags. Run the one that matches where your config repository lives, on every push to its default branch.
GitHub Actions
The earthly/lunar-actions/sync-config action pushes the latest config (manifest + snippets) from your config repo into Lunar Hub.
The action's inputs map 1:1 to the equivalent CLI flags — see the CLI reference for the full semantics of each.
Example
name: Sync Lunar Config
on:
push:
branches: [main]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: earthly/lunar-actions/sync-config@main
with:
manifest-url: github://my-org/my-config-repo@main
hub-token: ${{ secrets.LUNAR_HUB_TOKEN }}
hub-host: hub.example.com
lunar-version: v2.5.0
rerun-code-collectors: "true"Inputs
manifest-url
yes
—
<repo> positional argument (github://<org>/<repo>[/<config-path>]@<branch>)
hub-token
yes
—
LUNAR_HUB_TOKEN env var
hub-host
yes
—
LUNAR_HUB_HOST env var
hub-grpc-port
no
443
LUNAR_HUB_GRPC_PORT env var
hub-http-port
no
443
LUNAR_HUB_HTTP_PORT env var
rerun-code-collectors
no
false
--rerun-code-collectors / -l
include-pr-commits
no
false
--include-pr-commits
pr-max-age-days
no
5
--pr-max-age-days
log-level
no
debug
LUNAR_LOG_LEVEL env var
Versioning
Pin to @main for the latest, or to a release tag for stability. The lunar-version input selects the CLI version that gets downloaded; check the lunar-dist releases for the latest stable tag.
GitLab CI
There is no published GitLab CI component or template — you write a short job that runs the same lunar hub pull on every push to the config repository's default branch:
Set LUNAR_HUB_TOKEN as a masked CI/CD variable on the project or group (Settings → CI/CD → Variables), not in the file.
Useful flags
lunar hub pull accepts several options that change what happens after the config lands. The full list is in the CLI reference; the ones most often wanted in this job:
--rerun-code-collectors
Re-run affected code collectors after the pull. Off by default.
--rerun-catalogers
Re-run global catalogers after the pull. Off by default.
--dry-run
Validate without applying. The Hub is asked only to check the configuration's images.
Validating config on merge requests
--dry-run applies nothing, which makes it a good merge-request check. It asks the Hub to check the configuration's images and reaches GitLab to resolve any uses: plugins. It authenticates to the Hub with the job's CI job identity rather than the service token, which a merge request could read by editing the pipeline:
The token needs read access to the config repository and to any repositories its plugins come from. See Validating your config.
Cancel a bad config
Syncing a revert only helps commits pushed afterwards: the commits a bad config already judged stay pinned to it. To re-evaluate them under the fixed config, cancel the bad version with lunar hub pull --cancel once the revert has synced. See Cancel a Bad Config.
Last updated
