milanmk / actions-file-deployer

Composite GitHub Action (Linux runner) for deploying repository content to remote server. Fast and customizable deployment with proxy support. Deploy only changed files or do full sync/mirror of repository content.
The Unlicense
62 stars 14 forks source link

Error "Git repository not found" with files in repository #11

Closed aawnu closed 2 years ago

aawnu commented 2 years ago

I receive the following error: Error: Git repository not found. Please ensure you have a checkout step before this step.

But I have a repository and files in it:

jobs:
  deploy-queue:
    name: Deployment
    runs-on: ubuntu-latest
    steps:
      - name: "Checkout Queue"
        uses: actions/checkout@v3
        with:
          path: "public_queue/**"
          fetch-depth: 0
      - name: "Checkout Shared"
        uses: actions/checkout@v3
        with:
          path: "shared/**"
          fetch-depth: 0
      - name: "Log Structure"
        run: |
          pwd
          tree
      - name: "Deploy Files"
        uses: milanmk/actions-file-deployer@master
        with:
          remote-protocol: "sftp"
          remote-host: ${{ secrets.SSH_QUEUE_HOST }}
          remote-user: ${{ secrets.SSH_QUEUE_USERNAME }}
          remote-password: ${{ secrets.SSH_QUEUE_PASSWORD }}
          ssh-private-key: ${{ secrets.SSH_QUEUE_PRIVATE_KEY }}
          remote-path: ${{ secrets.SSH_QUEUE_REMOTE_PATH }}
          sync: "full"

I can not figure out what the error refers to more specific. Hope you can help

milanmk commented 2 years ago

The action checks if working directory on runner is actually a valid repository by running the following command git rev-parse --is-inside-work-tree. You can run this command after checking out two repository to see if a valid working tree is found or not.

aawnu commented 2 years ago

I only have the above and get the error, not sure what more information I can give.

aawnu commented 2 years ago

I went back and tried various things and the validation method you have added checks for a .git/ which is not present when using folder-structures like I did in this example.