actions-gh-pages icon indicating copy to clipboard operation
actions-gh-pages copied to clipboard

Not delete .git directory when publish_dir is GITHUB_WORKSPACE

Open pitosalas opened this issue 4 years ago • 1 comments

I've been trouble shooting this problem forever. I was getting errors that my directory was not a git directory, i.e. there was no .git subdirectory. I tracked it down to this action. Here's what I have in my yaml:

    - run: ls -la
    - uses: peaceiris/actions-gh-pages@v3
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        publish_dir: .
    - run: ls -la

And I can see that before running this action, I have a .git subdirectory, and after running it I don't. So this explains my mystery problem but I don't understand what to do about it. I tried publish_dir: ./public like you have in one of your examples but that doesn't work either in that it doesn't see any changed files.

pitosalas avatar Dec 16 '20 16:12 pitosalas

Only when we set publish_dir: ., this action deletes .git directory. This is my corner‐cutting and will be improved on the next release.

peaceiris avatar Jan 23 '21 19:01 peaceiris