Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/check-allium-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Check Allium vendor sync

# Fails if the vendored plugins/allium drifts from the juxt/allium ref pinned
# in scripts/allium-ref.txt. Runs only when the vendored copy, the pin, or the
# sync tooling changes — so unrelated PRs are unaffected, and it no-ops until
# plugins/allium is vendored.
on:
pull_request:
paths:
- "plugins/allium/**"
- "scripts/allium-ref.txt"
- "scripts/sync-allium.sh"
- ".github/workflows/check-allium-sync.yml"
workflow_dispatch:

jobs:
check-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify plugins/allium matches the pinned juxt/allium ref
run: bash scripts/sync-allium.sh --check
1 change: 1 addition & 0 deletions scripts/allium-ref.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
229ccd03684d377c07334732c5829296f189585c
57 changes: 57 additions & 0 deletions scripts/sync-allium.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env bash
#
# Re-vendor (or verify) plugins/allium from a pinned juxt/allium ref.
#
# scripts/sync-allium.sh # update plugins/allium to the pinned ref
# scripts/sync-allium.sh --check # exit non-zero if plugins/allium drifts
#
# The pinned ref lives in scripts/allium-ref.txt — a commit SHA or release tag
# of juxt/allium. Allium is an actively developed external repo, so its plugin
# payload is vendored here rather than referenced as a remote source (Codex
# only discovers local `./plugins/X` marketplace entries). Vendoring drifts
# silently; this script + the matching CI check keep the copy honest.
#
# To ship a new Allium release to the marketplace: bump scripts/allium-ref.txt
# to the new ref, run `scripts/sync-allium.sh`, and commit the result.
#
set -euo pipefail

ROOT="$(cd "$(dirname "$0")/.." && pwd)"
REF="$(tr -d '[:space:]' < "$ROOT/scripts/allium-ref.txt")"
DEST="$ROOT/plugins/allium"
MODE="${1:-sync}"

if [ -z "$REF" ]; then
echo "error: scripts/allium-ref.txt is empty" >&2
exit 2
fi

tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT

git clone --quiet https://github.com/juxt/allium "$tmp/allium"
git -C "$tmp/allium" checkout --quiet "$REF"
rm -rf "$tmp/allium/.git"

if [ "$MODE" = "--check" ]; then
if [ ! -d "$DEST" ]; then
echo "plugins/allium not present yet — nothing to check (vendor it with: scripts/sync-allium.sh)."
exit 0
fi
if diff -r "$tmp/allium" "$DEST" >/dev/null; then
echo "plugins/allium is in sync with juxt/allium@$REF"
else
echo "::error::plugins/allium is OUT OF SYNC with juxt/allium@$REF" >&2
diff -r "$tmp/allium" "$DEST" || true
echo "Run scripts/sync-allium.sh to update plugins/allium." >&2
exit 1
fi
elif [ "$MODE" = "sync" ]; then
rm -rf "$DEST"
mkdir -p "$DEST"
cp -R "$tmp/allium/." "$DEST/"
echo "Synced plugins/allium to juxt/allium@$REF"
else
echo "usage: scripts/sync-allium.sh [--check]" >&2
exit 2
fi