Skip to content

infra: add GitHub Actions extraction workflow and CI - #22

Merged
MekDrop merged 7 commits into
mainfrom
feat/extraction-workflow
Apr 23, 2026
Merged

MekDrop merged 7 commits into
mainfrom
feat/extraction-workflow

Conversation

@MekDrop

@MekDrop MekDrop commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

Closes #2

What

Adds the two GitHub Actions workflows that live permanently in the repo.

extract.yml — the extraction runner

Dispatched by the Cloudflare Worker via workflow_dispatch. Never modified at runtime — only secrets change per run.

Inputs: run_id, source_repo, source_path, target_repo, target_branch, target_path

Steps:

  1. pip install git-filter-repo
  2. Clone source via https://oauth2:${GE_SRC_<run_id>}@<host> — works for GitHub and GitLab
  3. git filter-repo --subdirectory-filter <source_path> --to-subdirectory-filter <target_path> --force
  4. Push to target via https://oauth2:${GE_TGT_<run_id>}@<host>

Secret names are unique per run_id so concurrent extractions never collide.

ci.yml — PR build check

Runs on every PR and push to main. Installs from root, then lints and builds each workspace. Steps use continue-on-error: true until workspaces are fully scaffolded (will be tightened in #19).

Test plan

  • extract.yml appears in Actions tab after merge
  • Can be dispatched manually with dummy inputs to verify it reaches the clone step
  • CI runs on this PR itself

MekDrop added 3 commits April 22, 2026 23:32
extract.yml — permanent workflow dispatched by the Cloudflare Worker
for every extraction job. Accepts run_id, source_repo, source_path,
target_repo, target_branch, and target_path as inputs. Secrets are
named GE_SRC_{run_id} and GE_TGT_{run_id} so concurrent runs never
collide. Supports any HTTPS-accessible repo (GitHub or GitLab).

ci.yml — runs on every PR and push to main: install, lint, build for
both workspaces. Steps use continue-on-error until workspaces are
fully scaffolded.

Closes #2
BFG mirror-clones the source repo and deletes all top-level dirs not
on the source path prefix — fast blob-level operation that strips the
bulk of irrelevant history before any path rewriting happens.

git-filter-repo then runs on the already-lean working clone to do the
subdirectory extraction and rename, which is much faster now that the
repo contains only the relevant subtree.

BFG requires a mirror clone and a gc pass after deletion.
git-filter-repo handles the precise --subdirectory-filter +
--to-subdirectory-filter rename that BFG cannot do.
@MekDrop

MekDrop commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator Author

Recreating in correct order — issue #2 should have lower PR number than issue #3.

@MekDrop MekDrop closed this Apr 22, 2026
@MekDrop MekDrop reopened this Apr 22, 2026
MekDrop added 4 commits April 23, 2026 02:57
BFG strips irrelevant top-level dirs from the mirror clone (fast,
blob-level). The path rename and deeper-level filtering are handled
entirely with git fast-export piped through awk into git fast-import —
native git, no extra tools.

awk rewrites M/D lines whose path matches source_path (or is prefixed
by source_path/) and drops all others, eliminating sibling dirs at
deeper levels that BFG cannot safely remove by name.
fast-export, fast-import and git push all work on bare repos.
No need to clone /tmp/source.git to /tmp/source.
@MekDrop
MekDrop merged commit 940486b into main Apr 23, 2026
1 check passed
@MekDrop
MekDrop deleted the feat/extraction-workflow branch April 23, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add permanent GitHub Actions extraction workflow

1 participant