fix: defensive cleanup of release-doc-sync workspace checkout (v1.8.2)#21
Merged
TMHSDigital merged 1 commit intomainfrom Apr 25, 2026
Merged
fix: defensive cleanup of release-doc-sync workspace checkout (v1.8.2)#21TMHSDigital merged 1 commit intomainfrom
TMHSDigital merged 1 commit intomainfrom
Conversation
v1.8.0 leaked a `.release-doc-sync` directory into caller release commits
as a 160000-mode gitlink (caller's `git add -A` picked up the meta-repo
checkout the action created via actions/checkout).
v1.8.1 attempted to fix this by checking out to ${{ runner.temp }}, but
actions/checkout@v5 enforces that `path:` resolves under GITHUB_WORKSPACE
and rejects out-of-tree paths with "Repository path '...' is not under
'...'" - so v1.8.1 broke the action entirely (caught immediately when
the Phase 2b cleanup commit triggered Docker's release.yml: bump
succeeded, sync failed, commit + tag steps were skipped).
This v1.8.2 ships the actually-working fix: keep the in-workspace
checkout (idiomatic actions/checkout) but add an `if: always()` cleanup
step that runs `rm -rf` on `.release-doc-sync` before control returns to
the caller. The caller's `git add -A` then sees nothing to add.
Regression test (`test_workspace_checkout_is_cleaned_up_before_action_returns`)
asserts:
- a cleanup step exists with `if: always()`
- the cleanup `rm -rf`s a path matching the checkout path
- the cleanup is positioned AFTER the run step
- the cleanup is scoped via ${{ github.workspace }}
Sanity-verified to fail loudly if any constraint is dropped.
The previous `test_meta_repo_checkout_is_outside_workspace` (v1.8.1's
guard, which asserted `runner.temp`) is replaced; that constraint was
unenforceable because actions/checkout rejects it.
Refs #5.
Signed-off-by: 154358121+TMHSDigital@users.noreply.github.com
Made-with: Cursor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
This was referenced Apr 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why v1.8.2 (and not just v1.8.1)
PR #20 shipped v1.8.1 attempting to fix the
.release-doc-syncgitlink pollution bug by moving the meta-repo checkout to${{ runner.temp }}/release-doc-sync. That fix did not work:actions/checkout@v5enforces thatpath:must resolve underGITHUB_WORKSPACE, and rejects out-of-tree paths with:This was caught immediately when the Docker cleanup PR (Docker#27) triggered Docker's
release.yml. Steps 1-7 (bump version) succeeded, step 8 (Sync release docs) failed at checkout, and steps 9-10 (commit + tag) were skipped — so v1.8.1 didn't pollute Docker, it just broke the action entirely. Run: https://github.com/TMHSDigital/Docker-Developer-Tools/actions/runs/24933696416What v1.8.2 does
Keeps the in-workspace checkout (idiomatic, supported by
actions/checkout@v5) and adds a defensive cleanup step:The cleanup step runs INSIDE the action, before control returns to the caller. The caller's
release.ymlgit add -A(the next step in the calling workflow) then sees nothing to add.if: always()guarantees cleanup even ifsync.pyexits non-zero.Regression test
Replaces the v1.8.1 guard (
test_meta_repo_checkout_is_outside_workspace, which was asserting an unenforceable constraint) withtest_workspace_checkout_is_cleaned_up_before_action_returns. The new test asserts:if: always().rm -rfs a path matching the checkout step'spath:value.runstep (otherwise it cleans before the script can use the checkout).run:references${{ github.workspace }}to scope the deletion explicitly.Sanity-verified on my workstation: the test fails with a clear message if the cleanup step is removed.
VERSION
1.8.1 → 1.8.2 (PATCH; bug fix, replaces a non-functional fix with a working one).
After merge, the
v1.0floating tag will be force-updated from v1.8.1 → v1.8.2 so consumers automatically get the working version.Refs
TMHSDigital/Developer-Tools-Directory#5.