Skip to content

Fix wiki file deletions not propagated when using clone strategy#88

Merged
Andrew-Chen-Wang merged 3 commits into
masterfrom
copilot/fix-wiki-file-deletion
Mar 8, 2026
Merged

Fix wiki file deletions not propagated when using clone strategy#88
Andrew-Chen-Wang merged 3 commits into
masterfrom
copilot/fix-wiki-file-deletion

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 7, 2026

When a file is deleted from the local wiki source directory, the corresponding page persisted in the GitHub wiki indefinitely. fs-extra.copy() only adds/overwrites files — it never removes destination files absent from the source.

Changes

  • Clear wiki clone before copy: Before copying source files into the cloned wiki repo, all non-.git entries are removed in parallel. This makes the clone a clean slate so git add -Av captures deletions correctly.
  • Use explicit d variable: The deletion loop references d directly rather than process.cwd(), consistent with how workspacePath is captured before process.chdir(d).
await Promise.all(
  (await readdir(d))
    .filter((entry) => entry !== ".git")
    .map((entry) => rm(resolve(d, entry), { recursive: true, force: true }))
);
// followed by the existing copy() call

No behavioral change for the init strategy — its working directory is already empty before the copy.

Original prompt

This section details on the original issue you should resolve

<issue_title>Action does not delete files in the wiki</issue_title>
<issue_description>When deleting a file in the /wiki dir and pushing, the relevant pages are not deleted</issue_description>

<agent_instructions>It seems like all operations except delete works. Unclear why; it does not seem like it has to do with the fact that it's a private repo.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@Andrew-Chen-Wang 1. do you have a reproduction? 2. does the action run successfully? 3. which version are you on?

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Andrew-Chen-Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with deleting files in the wiki Fix: wiki file deletions not propagated to GitHub wiki Mar 7, 2026
Co-authored-by: Andrew-Chen-Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com>
Copilot AI changed the title Fix: wiki file deletions not propagated to GitHub wiki Fix wiki file deletions not propagated when using clone strategy Mar 7, 2026
@Andrew-Chen-Wang Andrew-Chen-Wang marked this pull request as ready for review March 8, 2026 18:48
@Andrew-Chen-Wang Andrew-Chen-Wang merged commit 64efa0a into master Mar 8, 2026
13 checks passed
@Andrew-Chen-Wang Andrew-Chen-Wang deleted the copilot/fix-wiki-file-deletion branch March 8, 2026 18:48
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.

Action does not delete files in the wiki

2 participants