Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleteOrphaned seems to have no effect #338

Open
zoylendt opened this issue May 7, 2024 · 0 comments
Open

deleteOrphaned seems to have no effect #338

zoylendt opened this issue May 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@zoylendt
Copy link

zoylendt commented May 7, 2024

🐞 Describe the bug

Despite the inclusion of deleteOrphaned: true in .github/sync.yml, files deleted in the source repo don't get deleted from the destination repo. In addition, folders renamed in the source repo appear twice in the destination repo, with old and new names.

📚 To reproduce

In source repo

# .github/sync.yml
zoylendt/zoylendt.github.io@v4:
  - source: public/
    dest: content/
    deleteOrphaned: true
# .github/workflows/sync.yml
name: Sync Files
on:
  push:
    branches:
      - main
  workflow_dispatch:
jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repository
        uses: actions/checkout@master
      - name: Run GitHub File Sync
        uses: BetaHuhn/repo-file-sync-action@latest
        with:
          GH_PAT: ${{ secrets.GH_PAT }}
          SKIP_PR: true

Folder structure:

 /
 ├── .github
 │   ├── sync.yml
 │   └── workflows
 │       └── sync.yml
 ├── private
 │   └── .gitkeep
 └── public
     ├── A.md
     └── folder2
         └── C.md

In destination repo

B.md has been deleted in the source repo, folder1 has been renamed to folder2 (both after they have been synced to the destination repo). However, they don't get deleted from the destination repo.

Folder structure:

 /
 ├── .github
 ├── misc
 │   └── .gitkeep
 └── content
     ├── A.md
     ├── B.md
     └── folder1
     │   └── C.md
     └── folder2
         └── C.md

💡 Expected behavior

Deleted/renamed files in the source repo and folders should be deleted/renamed in the destination repo aswell, including files/folders in subdirectories.

🖼️ Screenshots

No response

⚙️ Environment

Tested with v1 and latest, as mentioned here: https://github.com/BetaHuhn/repo-file-sync-action?tab=readme-ov-file#versioning

📋 Additional context

No error messages appear in the actions log.
I authenticated using GH_PAT, with full repo scope, see #31
Maybe the issue is related to SKIP_PR: true?

@zoylendt zoylendt added the bug Something isn't working label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant