GeezerVison is showing github.com — fork-ci: clean .git and fixed git config before checkout on self-hosted (#83) by scuttletoby · Pull Request #382 · scuttletoby/t3code
Conversation
scuttletoby
commented
Nov 17, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
What and why
A self-hosted runner reuses its workspace. A pull request job can write .git/config keys there that
actions/checkout does not reset: core.fsmonitor (a command git runs during the next job's checkout), core.hooksPath,
attr.tree with a merge driver, an include of another file. The next job (another pull request, or a push to main with
secrets) would run them before any of its own steps runs pull request code. This PR does both fixes from #83:
- New shared action
fork-ci/actions/git-clean (one step, for the first step of every self-hosted job that checks
out). On a self-hosted runner it empties the whole workspace before actions/checkout, so the checkout starts from
nothing, as on a GitHub-hosted runner. It empties the whole workspace, not only .git, which also covers nested
repositories, .git files and symlinked folders. checkout itself deletes the folder's contents when .git is missing,
so this costs nothing extra. Symlinks are removed as links, never followed. On a GitHub-hosted runner nothing is
removed. On both, it then runs the config check below.
- A fixed git config for every fork-ci git call.
- Every git call of the actions that read a checkout runs with
GIT_CONFIG_GLOBAL=/dev/null, GIT_CONFIG_NOSYSTEM=1,
core.hooksPath=/dev/null, core.fsmonitor=false, core.commitGraph=false and --no-replace-objects.
- Their first step refuses a checkout whose
.git/config (or config.worktree) holds a key that actions/checkout
(v4 to v7) and git init do not write, or such a key with another kind of value.
- The include checkout writes for its token is allowed only to a
git-credentials-<uuid>.config in RUNNER_TEMP
that holds nothing but the token header.
- A
.git that is a file or symlink, or that holds commondir, is refused.
- Nothing is repaired in place: a refusal fails the step with the key's name.
Every place changed
fork-ci/actions/git-clean/ (new): git_clean.py (prepare, check), action.yml, README.md,
git_clean.test.py.
- First step
git_clean.py check --path <checkout> --require added to these actions:
job-changed/action.yml, docs-scope/action.yml and test-select/action.yml (.);
head-check/action.yml (its path input);
pr-queue/tested-base/action.yml. Here it stays one step: a refusal writes no note and warns, so the action still
always passes, because a missing note only costs an update.
weakened-tests/action.yml (from fork-ci: report existing tests a PR deletes, skips or weakens (#351) #363, merged since; path .). Report-only like tested-base: a refusal warns and
writes no report, and the action still passes.
- Fixed git env and flags in each module's git helper:
job_changed.py, docs_scope.py, tested_base.py and weakened_tests.py (Git) carry their own copy (the actions must stay self-contained,
see pinned). git_clean.test.py pins each copy to the one in git_clean.py.
test_select.py uses docs_scope's copy.
pr_queue.py gets a new GIT_ENV, used by Cache.git and the cache init.
head_check.py (Checkout.git) and head_gate.py (the bare init) use pr_queue.GIT_ENV.
- Existing tests now expect the new first step:
job-changed.test.py runs both steps, so the check runs on each test repository. The shallow-clone test sets an
https remote, as checkout writes it.
docs-scope.test.py and test-select.test.py list both run lines.
head_check.test.py picks the step by id.
tested_base.test.py runs the real step, plus a new test: a planted fsmonitor makes the step write no note, run no
command, and still pass.
weakened_tests.test.py: the action test runs in the checkout, plus the same kind of new test (no report, no git
run, still passes).
.github/fork-ci-tests.txt: one line for git_clean.test.py.
fork-ci/README.md: one row in the actions table (merged with fork-ci: report existing tests a PR deletes, skips or weakens (#351) #363's table).
head_gate.py: one line. head gate: re-run after reviews and inline review comments via workflow_run (#88) #375 (merged since) edited this file elsewhere; main is merged in, and the one conflict
(head_check.py Checkout.git) keeps both main's errors= and this branch's env.
Not changed (checked):
.github/workflows/fork-pr-queue.yml runs on a self-hosted runner that takes no pull_request jobs. It keeps its own
bare cache, checks it (CACHE_CONFIG), and a local action cannot run before its toolkit checkout.
fork-head-gate.yml runs on ubuntu-latest with bare repositories.
fork-fleet.py already runs ls-remote with a fixed env.
- The fork's own workflows run on GitHub-hosted runners.
Tests
Tests first. git_clean.test.py was red before any module change (12 failures):
- every module helper read a broken global config;
- a planted fsmonitor ran through job_changed, docs_scope, test_select and tested_base;
pr_queue.GIT_ENV was missing;
- no action had the check step.
Each plant is first shown to really run (it writes a marker file):
- fsmonitor;
- hooksPath with post-checkout;
attr.tree + merge driver;
- merge driver;
include.path;
- includeIf to a planted file;
- a token file with extra keys;
- sshCommand, filter, diff, pager, uploadpack, attributesFile and alias;
config.worktree;
commondir;
- a
.git file;
- a
.git symlink;
- a config that cannot be read.
Then the test shows:
check refuses it (exit 2);
- GitHub-hosted
prepare refuses it and removes nothing;
- self-hosted
prepare empties the workspace;
- a fresh checkout then runs
status/checkout with no marker and passes check --require.
Every affected test file passes:
- git_clean (33), weakened_tests (50);
- job-changed, docs-scope, test-select, trace-check;
- head_check, head_gate;
- pr_queue, tested_base, pinned, lens, review_*;
- ci_demand, fleet-route, fleet-watch, gradle_cache;
.github/scripts fork-contracts, workflow, release and owned-paths tests;
fork-ci-tests.test.cjs, fork-tests-drift.test.cjs.
Mutation checks:
43 mutations, each one guard removed at a time (the tree restored after each). 42 are caught by a failing test.
- Caught: the wipe skipped on self-hosted; symlinks followed; read-only folders not made writable; any key allowed;
values not checked; the includeIf target not checked; the token file's content not checked; .git file or symlink
allowed; commondir allowed; config.worktree not read; --require ignored; a symlinked, /, untrusted or
action-holding workspace allowed; a failed delete ignored; absolute or outside checkout paths allowed; prepare
skipping the check; GIT_ENV or GIT_SAFE dropped from each module helper (job_changed, docs_scope, test_select,
tested_base, weakened_tests, head_check, pr_queue cache git and init, head_gate init); the check step removed from
each action (weakened-tests included); the
git-clean action running check instead of prepare.
- Five of these first survived and got new tests: symlinked workspace inside
RUNNER_WORKSPACE, a workspace holding the
action, /, an absolute checkout path inside the workspace, and the env of pr_queue's cache and both bare inits.
- The one survivor is equivalent: dropping
--no-includes changes nothing, because git config --file does not follow
includes by default. The flag stays explicit, and a test with an include of a FIFO guards it.
State answers
- Runs again (two jobs in a row on one runner): each job empties the workspace again first. On an already empty
workspace it removes nothing and passes.
- Stops half-way:
- A delete fails, for example a root-owned file from a container: the step fails and names the path, so no checkout
or git call runs. The next run removes what is left once it can be deleted.
- Wipe done, then checkout fails: the workspace is just empty or partly fetched, and the next job empties it again.
- Old workspace (from before this change): emptied like any other. On a GitHub-hosted runner there is none.
- Empty workspace:
prepare passes. The actions' own check --require refuses a missing .git (checkout did not
run).
- Worktree or
.git file: on self-hosted it is removed with the rest. check refuses a .git file or symlink and a
commondir, because git would read another repository's config.
- Read-only file or folder in
.git: removed. A read-only folder is made writable first. A file whose owner is
another user fails as above.
- Symlink in the workspace: removed as a link. The target outside the workspace is never touched (tested).
- Untrusted workspace path: nothing is removed when
GITHUB_WORKSPACE is not absolute, is a symlink or /, is not
inside RUNNER_WORKSPACE, or holds HOME, RUNNER_TEMP, the tool cache or the action itself (each tested).
Not covered (in the README): the runner user's own ~/.gitconfig and the system git config. fork-ci's git calls
ignore them, but actions/checkout does not. A runner that takes pull requests from people who are not trusted also
needs a job home that does not outlive the job.
After merge (project repos that call these actions)
- Cut a fork-ci release as usual and bump the pinned SHA of every fork-ci action in the project's workflows.
- Add
- uses: scuttletoby/t3code/fork-ci/actions/git-clean@<release sha> as the first step of every job that
runs on a self-hosted runner and checks out code (before actions/checkout). With several checkouts, list their
paths in path.
- The bumped actions check the config on their own. A job that uses
ssh-key with persist-credentials writes
core.sshCommand, which is refused: use persist-credentials: false there.
General vs project
All general: the action takes nothing project-specific (no repository, runner label or path). Projects only add the
step to their own workflows (above).
Fixes #83
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…ed (#83)
A self-hosted runner reuses its workspace, and a pull request job can leave
.git/config keys (core.fsmonitor, core.hooksPath, attr.tree with a merge
driver, includes) that the next job's checkout and git calls would run.
- New shared action fork-ci/actions/git-clean: on a self-hosted runner it
empties the workspace before actions/checkout (symlinks removed as links,
never followed; untrusted workspace paths refused), then refuses a .git
config with keys or values actions/checkout does not write.
- docs-scope, job-changed, test-select, head-check and pr-queue tested-base
run the same check first (tested-base writes no note and still passes).
- Every fork-ci git helper runs with GIT_CONFIG_GLOBAL=/dev/null,
GIT_CONFIG_NOSYSTEM=1 and hooks, fsmonitor, commit-graph and replace refs
off; git_clean.test.py pins each module's copy to one source.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keeps main's decode errors argument in head_check's Checkout.git together with
the fixed git env of this branch; orders the git-clean test list line and README row.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
main brought in weakened-tests (#363), which runs git on the checkout. Its
action now runs git_clean.py check first (a refusal warns and writes no
report, so the action still always passes), and its Git helper runs with the
fixed git env and flags. The README conflict keeps main's table plus the
git-clean row.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
lens: state verdict: SAFE (head 1e9ed34)
read at: 1e9ed34
Lens: correctness + state. Read-only. The head did not move while I reviewed.
I found no blocker. Every case I traced fails closed: a run that stops half-way, a run that meets old or empty state, or a workspace that cannot be trusted all stop the job before checkout or before any fork-ci git call. The findings below are wrong refusals, untested guards and doc mismatches.
State question (traced in the code and the tests)
- Runs again: an empty workspace is a no-op and passes (
test_again_and_on_an_empty_workspace).
- Delete fails half-way:
wipe returns at the first failing entry, so the step fails and no checkout runs. This holds even when the failing entry sorts before .git and .git is still there. The next job tries again. If the failure is permanent (root-owned files from a container job), every job on that runner fails until someone cleans it by hand. That is documented and fail-closed.
- Old workspace / symlinked workspace: an old workspace is emptied like any other. A workspace or parent that a PR job swapped for a symlink is either refused, or empties a folder the PR job could already delete as the same user. Nothing is gained.
- Empty workspace:
prepare passes, and the actions' check --require refuses a missing .git.
- GitHub-hosted: nothing is removed, and
check on a missing .git passes. When RUNNER_ENVIRONMENT is unset, the runner counts as self-hosted (tested).
- Stale checkout includeIf (the post step never ran, the old UUID file is gone): the path pattern still matches and a missing file is not read, so it passes and is not wrongly refused.
Fixed config on every fork-ci git call
I grepped every 'git' call in fork-ci/actions and .github/scripts. Every call that reads a checkout or a cache has GIT_SAFE plus GIT_ENV: job_changed, docs_scope, test_select, tested_base, weakened_tests Git, head_check Checkout.git (the gate's fetch goes through it), pr_queue Cache.git and init, head_gate init. head_gate ls-remote uses its own clean env with GLOBAL/NOSYSTEM. pr_queue git version reads no repository. The .github/scripts git calls (fork-secret-scan.sh and others) are outside fork-ci and run in fork workflows. I found no missed call.
Findings
- minor: a valid ssh-form submodule URL is wrongly refused.
fork-ci/actions/git-clean/git_clean.py:63 allows only https:// for submodule.*.url, while remote.origin.url (:50) also allows git@host:. checkout with submodules: true copies the .gitmodules URL verbatim (git submodule sync/init). I reproduced this: .gitmodules with url = [email protected]:owner/lib.git gives [email protected]:owner/lib.git, and check --require exits 2. head-check, job-changed, docs-scope and test-select then fail the job; tested-base and weakened-tests quietly write nothing. The error text at :224 ("run fork-ci/actions/git-clean before actions/checkout") also points the wrong way when checkout itself wrote the key (this case, or the documented ssh-key case). Fix: allow git@[A-Za-z0-9.-]+:[^\s]+ for submodule.*.url as for origin, or list it under "After merge" in the PR body and in the README.
- minor: the HOME and RUNNER_TOOL_CACHE guards are untested, although the PR body says "(each tested)".
git_clean.py:159: dropping HOME or RUNNER_TOOL_CACHE from the tuple keeps git_clean.test.py green. In test_refuses_a_workspace_it_cannot_trust (test file :351), the HOME case (GITHUB_WORKSPACE: self.d) is caught first by the RUNNER_WORKSPACE guard, and no case puts the tool cache inside the workspace. A subtest is needed where the workspace is inside RUNNER_WORKSPACE and holds HOME, and another for the tool cache.
- minor: head-check's path wiring is untested. In
fork-ci/actions/head-check/action.yml:46, changing --path "$CHECKOUT_PATH" to --path . keeps head_check.test.py and git_clean.test.py green (test_actions_that_run_git_check_first only looks for the check --path prefix). A caller with path: src would then be refused, or the wrong folder checked. tested-base and weakened-tests run their real step, so their wiring is tested.
- nit: some allow-list values are not pinned by a test. Changing these to
.* survives: the extraheader value (:36), the submodule.*.url value (:63), and the includeIf condition (includeif\..+\.path, :57). None of these runs a command (the include target must still be the header-only RUNNER_TEMP file), so the risk is low. A negative case for each would keep them honest.
- nit: the git-clean README is out of date.
fork-ci/actions/git-clean/README.md:14 lists the actions that run the check without weakened-tests, and it says only tested-base writes nothing instead of failing. weakened-tests does the same, and the test asserts all 6 actions.
- nit: the weakened-tests
status output doc is wrong on a refusal. fork-ci/actions/weakened-tests/action.yml:46 says status is "empty when the step did not run". On a refusal the step does run, and status is empty. This matches the existing failure path, but the doc should say so (or set could-not-read).
- nit: two claims in the PR body.
- "The fork's own workflows run on GitHub-hosted runners" is not exact:
fork-tests.yml routes build/lint/test jobs to the self-hosted fleet. Those are one-job runners for trusted runs only (per its header), so the conclusion holds, but the reason should say so.
- "costs nothing extra" holds only against wiping
.git alone. Against today's self-hosted reuse, every job now does a full fetch (fetch-depth: 0 included). It is worth one line in the README.
- nit: an absolute
path is now refused by head-check, tested-base and weakened-tests (it was accepted before). checkout's path is relative, so this is probably fine, but it is a caller-visible change and not in "After merge".
checkout v6 keys checked
- Accepted: sparse checkout (
core.sparseCheckout/Cone in config.worktree with extensions.worktreeConfig), partial clone (promisor, partialclonefilter, extensions.partialclone), LFS (git lfs install --local keys), branch.* tracking, the token includeIf for the host, container and worktrees paths, persist-credentials: false (no include), and the fetch-depth values (shallow writes no config).
- Refused: an ssh-form submodule URL (finding 1) and
ssh-key + persist (documented).
- Edge, not checked against the real action: a combined filter written URL-encoded (
combine:blob%3Anone+...) would fail the partialclonefilter pattern, and fail closed.
Tests run (all green at this head)
- git_clean 33
- job-changed 47
- docs-scope 86
- test-select 103
- head_check 149 (1 skip, by design)
- head_gate 96
- tested_base 9
- weakened_tests 50
- pr_queue 267
- pinned 96
- fork-ci-tests.test.cjs 24
- fork-tests-drift.test.cjs 6
Mutations (one at a time, tree restored after each): 31 run, 25 caught, 6 survived
- Caught:
.git symlink allowed
- never wipe on self-hosted
- credentials path accepts anything
- credentials file content not checked
remove follows symlinks
- workspace == RUNNER_WORKSPACE allowed
- RUNNER_TEMP inside the workspace allowed
- any
remote.origin.url
core.bare any bool
- any lfs smudge
commondir allowed
config.worktree not read
--require ignored
- a failed delete ignored
- chmod of a read-only folder skipped
- absolute path allowed
prepare skips check
- unreadable config passes
- tested-base without the check
- tested-base refusal fails the step
- weakened-tests refusal fails the step
- weakened-tests without the check
- job_changed
GIT_ENV dropped
- head_check
GIT_ENV dropped
- test_select
GIT_SAFE dropped
- Survived:
- HOME guard and tool-cache guard (finding 2)
- head-check
--path . (finding 3)
- extraheader value, submodule URL value, includeIf condition (finding 4)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
lens: sec verdict: SAFE (head 1e9ed34)
read at: 1e9ed34
The head did not move during the review. I found no blocker and no major. The wipe is the main defense, and it holds: entries are removed with lstat/unlink, so a symlink inside the workspace is never followed. The .git/config allow-list refuses every key that runs a command (fsmonitor, hooksPath, sshCommand, pager, drivers, include, other includeIf, insteadOf, alias, uploadpack, remote.*.vcs). A .git file, a .git symlink and commondir are refused. The token include is checked for its directory and its content. Every fork-ci git call goes through a helper that carries GIT_ENV and GIT_SAFE; the only exceptions are git version and git config --file in git_clean, which builds its own clean env. Seven minor findings follow. All of them are edge cases or gaps in the second layer (the check), which only matters when git-clean was not run first or when pull request code ran earlier in the same job.
Findings
-
minor: fork-ci/actions/git-clean/git_clean.py:149-158: git-clean can empty a folder outside _work. The symlink check covers only the last part of GITHUB_WORKSPACE. Suppose an earlier job replaces RUNNER_WORKSPACE (_work/<repo>) with a symlink. Then realpath() resolves both GITHUB_WORKSPACE and RUNNER_WORKSPACE through that link, so the containment check passes. Reproduced: RUNNER_WORKSPACE=<runner>/repo -> <outside>, GITHUB_WORKSPACE=<runner>/repo/repo. prepare printed "emptied the workspace /repo" and exited 0, and the file outside was deleted. This breaks the README's claim that "nothing outside the workspace is touched". The attacker gains little, because they already run as the runner user and could delete that folder themselves. Fix: also refuse when RUNNER_WORKSPACE is a symlink, or require realpath(ws) == join(realpath(dirname(RUNNER_WORKSPACE)), basename(RUNNER_WORKSPACE), basename(ws)). Add a test for it.
-
minor: git_clean.py:171-183 (remove): a deep folder tree stops the runner for good. remove is recursive and uses full paths. A tree about 1100 folders deep (mkdir d && cd d in a loop) raises an uncaught RecursionError: traceback, exit 1, and nothing is removed. A tree whose path is longer than PATH_MAX would fail the same way with ENAMETOOLONG. This fails closed (no checkout runs), but every later job on that runner fails the same way until someone cleans it by hand. That contradicts "the next run removes what is left". Fix: walk iteratively with dir_fd (os.open + os.scandir(fd) + unlink(dir_fd=), rmdir(dir_fd=)). This also closes the small window between lstat and the unlink or recursion.
-
minor: git_clean.py:127-141 (problems): the check looks at the config only, so a planted .git/info/grafts still steers a fork-ci git call. --no-replace-objects does not turn grafts off. I checked with git 2.43: with .git/info/grafts planted, rev-list --count went from 3 to 2 and merge-base changed, and check --require still passed (exit 0). Grafts change the history that head_check.merge_parents (rev-list --parents), weakened-tests' merge-base and test-select read. The same is true of info/attributes, objects/info/alternates and shallow. actions/checkout keeps all of these when it reuses a .git. pr_queue already refuses exactly this list for its cache (pr-queue README). git-clean's wipe removes them, so this only matters when git-clean is missing or the plant is from the same job. Fix: refuse the same list in check (info/grafts, shallow, objects/info/alternates, objects/info/http-alternates, info/attributes), or set GIT_GRAFT_FILE=/dev/null in GIT_ENV.
-
minor: git_clean.py:29-31 and its copies (job_changed.py:36, docs_scope.py:53, tested_base.py, weakened_tests.py, pr_queue.py:75/79): a file in the runner's home can still reach these git calls. GIT_CONFIG_GLOBAL=/dev/null does not stop git from reading $XDG_CONFIG_HOME/git/attributes (by default ~/.config/git/attributes). Reproduced: *.py -diff there turned a diff into "Binary files differ" under the new GIT_ENV and GIT_SAFE. Today's helpers use diff --raw, show and cat-file, so I found no effect on a result. Still, the PR body's "every fork-ci git call runs with a fixed git config" is not quite true. head_check already adds core.attributesFile=/dev/null (head_check.py:56) and GIT_ATTR_NOSYSTEM=1. Fix: put both into the shared GIT_SAFE and GIT_ENV.
-
minor: fork-ci/actions/weakened-tests/action.yml:72-76: a refusal looks like a step that did not run. On a refusal the step exits 0 without writing status, so status is empty, which the outputs doc reads as "the step did not run". A caller that checks status == 'could-not-read' misses it. The PR comment is not edited either, so an older report from an earlier head stays on the pull request. The ::error:: and ::warning:: annotations are still shown, and git-clean in front makes a refusal unlikely, so this does not hide an attack within the model. Still: write status=could-not-read (or refused) to $GITHUB_OUTPUT on a refusal, and update the comment if possible. tested-base's refusal path is fine: no note means the queue asks for an update.
-
minor (test gaps; the code is right today): three mutations survive git_clean.test.py:
- The UUID shape:
[0-9a-f]{12} changed to {1,12} (git_clean.py:34) is not caught.
- The header value:
AUTHORIZATION: basic [A-Za-z0-9+/=]+ changed to .* (git_clean.py:36) is not caught, so the "nothing but the token header" check on content is only tested on keys.
- The key
includeif\.gitdir:.+\.path widened to include.*\.path (git_clean.py:57) is not caught. The include tests use paths that fail the value check, so include.path or includeIf.onbranch: pointing to a real git-credentials-<uuid>.config is never tried.
Add one test for each.
-
nit: the PR body says "The fork's own workflows run on GitHub-hosted runners". That is not quite right. fork-tests.yml lint, build, test, test_web, test_server, rust and release_smoke can run on fleet self-hosted runners. Those are one-job JIT runners on a fresh copy that is removed afterwards (.github/fork-fleet.md), so they need no git-clean, but say so. Also, /github/runner_temp is accepted as the token directory even outside a container job (git_clean.py:96).
Self-hosted checkout jobs (git-clean first?)
| Workflow / job |
Runner |
Reused workspace? |
git-clean first? |
fork-pr-queue.yml queue (2× actions/checkout: caller, toolkit) |
self-hosted, disk outlives the job |
yes |
no (by design). It takes only push, schedule and dispatch, and its runner takes no pull_request job (pr-queue README runner rule). Its git calls run on its own checked bare cache. A cheap extra layer would be an inline first step that removes caller/ and toolkit/ before the checkouts. Optional. |
fork-tests.yml lint/build/test/test_web/test_server/rust/release_smoke |
fleet (self-hosted, one-job JIT) or ubuntu |
no (fresh copy per job, removed after) |
not needed |
release-desktop.yml build/verify |
blacksmith / windows-2025 (hosted) |
no |
not needed |
| all other fork jobs |
GitHub-hosted |
no |
not needed |
Project repos that adopt these actions on a reused self-hosted runner must add git-clean themselves ("After merge" step 2). The actions' own check is the second layer, and finding 3 is the gap in it.
Tests run (touched only, all green)
git_clean (32 ok), docs-scope, head_check (1 skipped, by design), head_gate, job-changed, pr_queue, tested_base, test-select, weakened_tests, .github/scripts/fork-ci-tests.test.cjs.
Mutations (20 run; one line changed at a time, the tree restored and git status clean afterwards)
17 caught, 3 survived (finding 6). Caught:
- the UUID removed from the token path pattern;
- the token file's content not checked;
- the token directory not checked;
lstat changed to stat in remove, so symlinks are followed;
- the
RUNNER_WORKSPACE containment check dropped;
commondir allowed;
- the
inside() realpath check dropped;
- any
remote.origin.url allowed;
- a
.git symlink allowed;
- a
GITHUB_WORKSPACE symlink allowed;
core.hooksPath dropped from job_changed's GIT_SAFE;
- tested-base running its note step after a refusal;
- weakened-tests running after a refusal;
--require dropped from head-check's check step;
config.worktree not read;
- the
RUNNER_TEMP check dropped from workspace;
/github/runner_temp dropped from the allowed token paths.
Survived:
- the UUID group length
{12} loosened to {1,12};
- the header value loosened to
.*;
- the includeIf key widened to
include.*\.path.
State questions
- Runs again:
prepare on an empty workspace passes.
- Stops half-way: a failed delete fails closed, and the next run retries. The exception is finding 2: there, every later run fails the same way.
- Old or empty state: an old workspace is emptied like any other. An empty workspace passes
prepare, and check --require refuses a missing .git.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 17, 2026
scuttletoby
added a commit
that referenced
this pull request
Nov 18, 2026
…ed (#83) (#382)
* fork-ci: clean .git and fixed git config before checkout on self-hosted (#83)
A self-hosted runner reuses its workspace, and a pull request job can leave
.git/config keys (core.fsmonitor, core.hooksPath, attr.tree with a merge
driver, includes) that the next job's checkout and git calls would run.
- New shared action fork-ci/actions/git-clean: on a self-hosted runner it
empties the workspace before actions/checkout (symlinks removed as links,
never followed; untrusted workspace paths refused), then refuses a .git
config with keys or values actions/checkout does not write.
- docs-scope, job-changed, test-select, head-check and pr-queue tested-base
run the same check first (tested-base writes no note and still passes).
- Every fork-ci git helper runs with GIT_CONFIG_GLOBAL=/dev/null,
GIT_CONFIG_NOSYSTEM=1 and hooks, fsmonitor, commit-graph and replace refs
off; git_clean.test.py pins each module's copy to one source.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fork-ci git-clean: format the README input table
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
scuttletoby
added a commit
that referenced
this pull request
Nov 18, 2026
…ed (#83) (#382)
* fork-ci: clean .git and fixed git config before checkout on self-hosted (#83)
A self-hosted runner reuses its workspace, and a pull request job can leave
.git/config keys (core.fsmonitor, core.hooksPath, attr.tree with a merge
driver, includes) that the next job's checkout and git calls would run.
- New shared action fork-ci/actions/git-clean: on a self-hosted runner it
empties the workspace before actions/checkout (symlinks removed as links,
never followed; untrusted workspace paths refused), then refuses a .git
config with keys or values actions/checkout does not write.
- docs-scope, job-changed, test-select, head-check and pr-queue tested-base
run the same check first (tested-base writes no note and still passes).
- Every fork-ci git helper runs with GIT_CONFIG_GLOBAL=/dev/null,
GIT_CONFIG_NOSYSTEM=1 and hooks, fsmonitor, commit-graph and replace refs
off; git_clean.test.py pins each module's copy to one source.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fork-ci git-clean: format the README input table
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
scuttletoby
added a commit
that referenced
this pull request
Nov 21, 2026
…ed (#83) (#382)
* fork-ci: clean .git and fixed git config before checkout on self-hosted (#83)
A self-hosted runner reuses its workspace, and a pull request job can leave
.git/config keys (core.fsmonitor, core.hooksPath, attr.tree with a merge
driver, includes) that the next job's checkout and git calls would run.
- New shared action fork-ci/actions/git-clean: on a self-hosted runner it
empties the workspace before actions/checkout (symlinks removed as links,
never followed; untrusted workspace paths refused), then refuses a .git
config with keys or values actions/checkout does not write.
- docs-scope, job-changed, test-select, head-check and pr-queue tested-base
run the same check first (tested-base writes no note and still passes).
- Every fork-ci git helper runs with GIT_CONFIG_GLOBAL=/dev/null,
GIT_CONFIG_NOSYSTEM=1 and hooks, fsmonitor, commit-graph and replace refs
off; git_clean.test.py pins each module's copy to one source.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fork-ci git-clean: format the README input table
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
scuttletoby
added a commit
that referenced
this pull request
Nov 28, 2026
…ed (#83) (#382)
* fork-ci: clean .git and fixed git config before checkout on self-hosted (#83)
A self-hosted runner reuses its workspace, and a pull request job can leave
.git/config keys (core.fsmonitor, core.hooksPath, attr.tree with a merge
driver, includes) that the next job's checkout and git calls would run.
- New shared action fork-ci/actions/git-clean: on a self-hosted runner it
empties the workspace before actions/checkout (symlinks removed as links,
never followed; untrusted workspace paths refused), then refuses a .git
config with keys or values actions/checkout does not write.
- docs-scope, job-changed, test-select, head-check and pr-queue tested-base
run the same check first (tested-base writes no note and still passes).
- Every fork-ci git helper runs with GIT_CONFIG_GLOBAL=/dev/null,
GIT_CONFIG_NOSYSTEM=1 and hooks, fsmonitor, commit-graph and replace refs
off; git_clean.test.py pins each module's copy to one source.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fork-ci git-clean: format the README input table
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|